Starting A Mod
Setting up your project
This guide follows certain parts of the official BepInEx guide and the Lethal Company Modding Wiki.
Using the dotnet template
First things first, you'll need to create your project. If you've not done so already, I recommend running the following command in a console to add some Content Warning templates for new projects:
Next, you'll want to create a new project (sometimes called "solution", in C#). There are two main ways to do this.
Using an IDE (easier)
Depending on your IDE, this process will look slightly different. You'll want to give the solution the name of your soon-to-be mod. If given the option to use a template (you may want to google for "how to use template in Visual Studio" or "how to use template in Rider"), use the ``Content Warning Harmony Mod Template`
** Using the console (recommended for control) Alternatively, you can open a console and run the following command, assuming you've set up the templates using the command above. Replace MyFirstMod with your mod's name, and MyName with your username:
To see the other options provided in the mod template, you can use the following command:
Note for MonoMod users
MonoMod Template
Fixing an issue
Currently the Content Warning game assemblies may not be functional. You can test this by going to your project's main CS file and typing at the top:
If it does not give an error, you may skip this section.
To fix this, open your csproj file by double-clicking it.

Then locate the highlighted line, and cut (CTRL + X) it:

Finally, paste it into the highlighted position:

Then you can save and close out of the csproj file, because you've fixed it! Now retry the first step in this section. If it doesn't give an error, then you're done here.
"Building" your mod
Your IDE is capable of turning your code into a file that can be run (in this case by BepInEx as a mod). This process is called "building" or "compiling". In this case, it will turn your code into a .dll
file. This file is your mod.
Depending on your IDE, the build button may be placed differently.
Visual Studio
Rider
VS Code
Once built, you should be able to find the .dll
file in your project's folder, in the following subfolder path (once again replacing MyFirstPlugin
with the name you gave your mod/project): MyFirstPlugin/bin/(Release or Debug)/netstandard2.1/MyFirstPlugin.dll
Simply copy & paste this .dll
file into the BepInEx/plugins
folder, in your game directory, and it should run the mod. I recommend keeping the default LogInfo
statement in your Awake
method that comes with the template. If you have this statement, you should see it appear in the console that opens when you run the game (after installing BepInEx, and enabling the console as per the first wiki article).
Additional guides
I highly recommend reading through the rest of the official BepInEx guide for extra information.
Next steps
I recommend reading through lethal.wiki's very short guide on open-source & ethics, to help foster a healthy modding community.
I also recommend renaming your mod's main class to Plugin.cs
.
Once you've finished a mod, you can publish it