Build, Deploy & Debug
You've written the code — now how do you get it running in the game?
Compiling
Use Visual Studio / Rider or the command line:
dotnet build -c DebugThe template project references DLLs from the game directory, so before building make sure:
- The game has been set up with UMM (injected)
- The assembly paths in
.csprojexist (usually$(ADOFAI_PATH)or a relative path)
Deploying: Put the Output in Mods
The template usually has "auto-copy after build" configured:
MyFirstMod.dll → ADOFAI/Mods/MyFirstMod/
Info.json → ADOFAI/Mods/MyFirstMod/If the template doesn't auto-deploy, copy manually. When publishing, you also need to put these two files together.
Verifying in Game
- Launch the game and open the UMM interface (default
Ctrl+F10) - Find MyFirstMod in the Mod list and check the enable box
- Watch the log for
Mod loadedoutput - If your Mod isn't in the list, check:
- Does
Info.json'sAssemblyNamematch the actual DLL filename - Is
EntryMethodin the formatNamespace.Class.Load - Was the compiled output actually copied to
Mods/
- Does
Debugging Tips
1. Use Logs to Locate Problems
modEntry.Logger.Log($"Current value: {value}"); // Output to UMM interface2. Hot Reload After Changes
UMM supports disabling then re-enabling a Mod in-game: uncheck then recheck it in the UMM interface. This applies new code without restarting the game (provided you've recompiled and overwritten the DLL).
3. Check Player.log on Crash
Exceptions thrown by your Mod are written to the game log (see Getting to Know UMM for log location). When you see NullReferenceException, first check:
- Did you access
SettingsbeforeOnToggle - Does your Harmony patch signature match the target method
4. Attach a Debugger (Optional)
In your IDE, use "Attach to Process" and select A Dance of Fire and Ice.exe to set breakpoints directly in C# code. Note: you need to compile in Debug configuration, and the game must be running first.
What You Learned
- How to compile and deploy a Mod to the game directory
- How to enable, verify, and hot-reload a Mod in-game
- How to troubleshoot using logs and
Player.log
Next Step
Learn to modify game behavior with Harmony → Harmony Introduction