Build fails: Krafs.Publicizer.props not found
Build fails: Krafs.Publicizer.props not found
The Solution: restore NuGet packages.From the command line:Or in Visual Studio: right-click the solution in Solution Explorer and select Restore NuGet Packages.After restoring, the
.csproj imports Krafs.Publicizer.2.3.0\build\Krafs.Publicizer.props and verifies it exists before the build starts. If the NuGet package has not been restored, this file is missing and MSBuild emits an error like:packages\Krafs.Publicizer.2.3.0\ directory will exist next to your solution file and the build will proceed.Build fails: could not find Main.dll (or other ChroMapper DLLs)
Build fails: could not find Main.dll (or other ChroMapper DLLs)
MSBuild resolves all
<HintPath> references through the $(ChroMapperDir) environment variable. If the variable is not set, or points to the wrong directory, the compiler cannot find Main.dll, Plugins.dll, 0Harmony.dll, or any other ChroMapper assembly.Solution:-
Confirm
ChroMapperDiris set and points to the root of your ChroMapper installation — the folder that contains theChroMapper.exeexecutable. -
Verify the path is correct by checking that this file exists:
- Restart your IDE after setting or changing the variable. MSBuild reads environment variables at startup, so an already-open IDE session will not see the updated value.
Plugin doesn't appear in ChroMapper
Plugin doesn't appear in ChroMapper
ChroMapper loads plugins from its
Plugins directory and registers every class decorated with [Plugin].Check the following:-
DLL was copied — confirm the post-build step ran successfully and your
.dllis present in$(ChroMapperDir)\Plugins\. If the post-build xcopy failed, copy the DLL manually frombin\Debug\orbin\Release\. -
[Plugin]attribute is present — the plugin entry-point class must be decorated with[Plugin(Name)]: - Class is public — ChroMapper uses reflection to find plugin classes; a non-public class will not be found.
-
Check ChroMapper logs — open
%APPDATA%\..\LocalLow\BinaryElement\ChroMapper\Player.log(or the log path shown in ChroMapper’s settings) for error messages about plugin loading.
xcopy fails during post-build
xcopy fails during post-build
The post-build target runs two
xcopy commands to copy the compiled output to $(ChroMapperDir)\Plugins\. If either command fails, the build reports a non-zero exit code.Common causes:-
ChroMapperDiris not set — xcopy receives an empty path and fails. Set the variable and restart your IDE (see the entry above). -
Pluginsdirectory does not exist — xcopy cannot copy into a directory that doesn’t exist. Launch ChroMapper at least once so it creates thePluginsfolder, or create it manually: -
Insufficient permissions — if ChroMapper is installed in a protected location (e.g.,
C:\Program Files\), xcopy may be blocked by UAC. Run your IDE as administrator, or move ChroMapper to a user-writable path.
Harmony patches aren't being applied
Harmony patches aren't being applied
If your
[HarmonyPatch] classes compile and load without errors but the patches have no effect, work through this checklist:-
PatchAllis called in[Init]— confirm yourInitmethod callsPatchAll: -
Harmony ID is unique — if another loaded plugin uses the same Harmony ID, patches from both plugins are grouped together and one may override the other. Ensure your
AuthorandNameconstants produce a uniqueID. -
[HarmonyPatch]targets the correct type and method — double-check the type and method name in your patch attribute. A typo or wrong overload silently skips the patch: -
Patch method names are correct — Harmony recognizes
Prefix,Postfix,Transpiler, andFinalizerby convention. Any other name is ignored.
CS0122: inaccessible due to protection level on ChroMapper types
CS0122: inaccessible due to protection level on ChroMapper types
This error means you are trying to access an
internal or private member of a ChroMapper type that Krafs.Publicizer has not yet publicized — most often because the NuGet package is not restored.Solution:- Restore NuGet packages (see the Krafs.Publicizer entry above).
-
Confirm
packages.configlists Krafs.Publicizer: -
Confirm the
.csprojimports the Publicizer props and targets: