To use Harmony 2.0.0.8 in your mod, add the HarmonyLib nuget package to your project. Make sure that the 0Harmony.dll is not copied to the output directory.
Also make sure that there are no references to HarmonyLib in your IUserMod
implementation.
Otherwise the mod could not be loaded if CitiesHarmony is not subscribed.
Before calling harmony methods, check if the CitiesHarmony
assembly is present.
If it is not installed, you can either auto-subscribe it or show a warning to the user (depending on your preference).
When you are certain that CitiesHarmony is available, call CitiesHarmony.Provider.CreateHarmony(yourHarmonyID)
by reflection to get your Harmony
instance.
This will ensure that old Harmony versions get patched before Harmony 2.x patches are applied.
Add this mod as a dependency to your workshop item.
You can use this mod as a reference. By using auto-subscription, it is possible to migrate existing mods to Harmony 2.x without causing disruptions for users!