Skip to main content

Project Setup

This guide walks through installing Deadworks and setting up a Visual Studio project for plugin development.

Prerequisites

0. Install Deadlock

You can use your locally installed version of Deadlock, but for running a server, it's recommended to follow the server hosting instructions.

1. Install Deadworks

Download the latest release from https://github.com/Deadworks-net/deadworks/releases and extract it into your Deadlock folder (C:\Program Files (x86)\Steam\steamapps\common\Deadlock).

2. Create a Class Library Project

In Visual Studio, create a new C# Class Library project. The project name can be anything, so pick whatever you want.

Important: Target .NET Core (e.g. net10.0), not .NET Standard. Deadworks requires a .NET Core runtime.

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

3. Add API References

Add assembly references to the Deadworks API and Google Protobuf DLLs from your Deadlock installation:

<ItemGroup>
<Reference Include="DeadworksManaged.Api">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\Deadlock\game\bin\win64\managed\DeadworksManaged.Api.dll</HintPath>
</Reference>
<Reference Include="Google.Protobuf">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\Deadlock\game\bin\win64\managed\Google.Protobuf.dll</HintPath>
</Reference>
</ItemGroup>

Note: Adjust the HintPath if your Steam library is in a different location. The DLLs are also available in the managed/ folder of this repository.

4. Configure Auto-Deploy (Optional)

Add a post-build target to automatically copy your compiled plugin to the game's plugin directory:

<Target Name="DeployToGame" AfterTargets="Build">
<ItemGroup>
<DeployFiles Include="$(OutputPath)REPLACE_THIS_WITH_YOUR_PLUGIN_OUTPUT_NAME.dll;$(OutputPath)REPLACE_THIS_WITH_YOUR_PLUGIN_OUTPUT_NAME.pdb" />
</ItemGroup>
<Copy
SourceFiles="@(DeployFiles)"
DestinationFolder="C:\Program Files (x86)\Steam\steamapps\common\Deadlock\game\bin\win64\managed\plugins"
SkipUnchangedFiles="false"
Retries="0"
ContinueOnError="WarnAndContinue" />
</Target>

Replace REPLACE_THIS_WITH_YOUR_PLUGIN_OUTPUT_NAME with the actual file name your plugin project builds, without the .dll or .pdb extension. For example, if your project builds CoolPlugin.dll, use CoolPlugin.dll and CoolPlugin.pdb.

5. Complete .csproj Example

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace>MyPlugin</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<Reference Include="DeadworksManaged.Api">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\Deadlock\game\bin\win64\managed\DeadworksManaged.Api.dll</HintPath>
</Reference>
<Reference Include="Google.Protobuf">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\Deadlock\game\bin\win64\managed\Google.Protobuf.dll</HintPath>
</Reference>
</ItemGroup>

<Target Name="DeployToGame" AfterTargets="Build">
<ItemGroup>
<DeployFiles Include="$(OutputPath)MyPlugin.dll;$(OutputPath)MyPlugin.pdb" />
</ItemGroup>
<Copy
SourceFiles="@(DeployFiles)"
DestinationFolder="C:\Program Files (x86)\Steam\steamapps\common\Deadlock\game\bin\win64\managed\plugins"
SkipUnchangedFiles="false"
Retries="0"
ContinueOnError="WarnAndContinue" />
</Target>
</Project>

Plugin Deployment

Compiled plugin DLLs are loaded from:

Deadlock/game/bin/win64/managed/plugins/

Copy the full build output to the Deadlock/game/bin/win64/managed/plugins/ folder

Plugins are loaded automatically when the server starts. Editing a plugin DLL while the server is running hot-reloads it.

6. Run Deadworks

Run deadworks.exe from your Deadlock/game/bin/win64/ folder.

Once Deadworks is running, open Deadlock and connect to your local server from the in-game console:

connect localhost:27067

Troubleshooting

SymptomSolution
No pink console output at allDeadworks files not extracted to the correct directory. Verify files exist in Deadlock/game/bin/win64/
"Failed to initialize .NET runtime"Install or repair the .NET 10.0 SDK.
Plugins folder is silently ignoredThe .NET SDK isn't installed or is the wrong version.
"Unknown command 'dw_plugin'"The runtime hasn't loaded, check for errors earlier in the pink console output
No IntelliSense in Visual StudioEnsure DeadworksManaged.Api.xml is in the same folder as the Deadworks DLL
Build targets .NET StandardChange your project to target net10.0 (.NET Core), not .NET Standard

Next Steps