Plugins folder as part of the build. This page walks through everything you need to do from setting up your environment to verifying your plugin loads.
Prerequisites
Set the variable in your user environment (persists across sessions):Restore NuGet packages
The project depends on Krafs.Publicizer 2.3.0. You must restore packages before your first build, otherwise theEnsureNuGetPackageBuildImports target will abort the build with:
Build configurations
The project ships with two standard MSBuild configurations:| Configuration | DebugSymbols | Optimize | Output path | Extra output |
|---|---|---|---|---|
Debug | true (full) | false | bin\Debug\ | .pdb file copied to Plugins\ |
Release | pdbonly | true | bin\Release\ | DLL only |
.pdb file lets Unity’s stack traces show line numbers. Use Release for distribution.
The post-build deploy step
After every successful build the.csproj runs a PostBuild target that copies the output to ChroMapper’s Plugins directory:
- The first
<Exec>always copies the DLL. - The second
<Exec>only runs in theDebugconfiguration and copies the.pdbalongside it.
/Y flag overwrites without prompting; /F prints the source and destination paths so you can confirm the copy happened in the build output.
Building from the CLI
You can also invoke MSBuild directly if
dotnet build is not available:
Building from Visual Studio
Open the solution
Double-click your
.csproj or open Visual Studio and use File → Open → Project/Solution.xcopy lines from the post-build step, confirming the DLL was copied to $(ChroMapperDir)\Plugins\.
Where ChroMapper loads plugins from
ChroMapper scans thePlugins subdirectory of its installation folder on startup. The post-build target writes your DLL there automatically, so a clean build-then-launch cycle is all you need:
Verifying your plugin loaded
Your plugin’sInit method emits a log message:
- ChroMapper’s in-editor console — visible at the bottom of the ChroMapper window if the developer console is open.
-
Unity’s player log — written to:
Search the log for your plugin’s name to confirm it initialised without errors.
What if my plugin doesn't appear in the log?
What if my plugin doesn't appear in the log?
Check the following:
- The DLL is in
$(ChroMapperDir)\Plugins\(the post-buildxcopyoutput confirms this). - The class is decorated with
[Plugin(Name)]and the init method with[Init]. - NuGet packages were restored — an incomplete Krafs.Publicizer restore can silently produce a DLL that fails to load.
- The
ChroMapperDirvariable pointed to the correct installation when you built.