STEAM GROUP
Harmony for Games HarmonyLib
STEAM GROUP
Harmony for Games HarmonyLib
4
IN-GAME
16
ONLINE
Founded
22 March, 2021
All Discussions > Cities Skylines > Topic Details
OldBlueBen 1 Apr, 2021 @ 9:10am
ensuring Harmony loads before local mods?
I am toying with creating a local mod, and I seem to need to have Harmony load first.
Issue 9 on Github indicates that I can just rename Harmony's folder, but I am not sure where said folder is located, or whether i need to move it as well as rename it.
Sorry to come at you from such a pedestrian level (noob modder stuff), but I would sure appreciate some guidance.
Cheers,
OBB

-edit: installed Harmony Redesigned as local mod and renamed folder to be alphabetically before my mod's folder. still getting load exception, specifically missing dependency System.Runtime 5.0...
Last edited by OldBlueBen; 1 Apr, 2021 @ 9:23am
Originally posted by Chaos:
Issue 9 describes the mechanism for the TypeLoadException being caused by broken mods. It's a failure analysis, if you will.

What you need to do is not address the symptom (TypeLoadException), but the cause, which is that you have a type which references HarmonyLib, and is an exported type (ie, public class).

The class that references HarmonyLib needs to be a non-public class (either private or internal). Then the error does not occur, and your mod is not load-order dependent.

EDIT: You can see the solutions I proposed to another mod that had this problem, in the "Solutions" section of issue 9

EDIT 2: If you're missing a Runtime 5.0 dependency it means you're probably targeting the wrong framework. You should target .Net Framework 3.5
< >
Showing 1-3 of 3 comments
A moderator of this forum has indicated that this post answers the original topic.
Chaos 1 Apr, 2021 @ 4:30pm 
Issue 9 describes the mechanism for the TypeLoadException being caused by broken mods. It's a failure analysis, if you will.

What you need to do is not address the symptom (TypeLoadException), but the cause, which is that you have a type which references HarmonyLib, and is an exported type (ie, public class).

The class that references HarmonyLib needs to be a non-public class (either private or internal). Then the error does not occur, and your mod is not load-order dependent.

EDIT: You can see the solutions I proposed to another mod that had this problem, in the "Solutions" section of issue 9

EDIT 2: If you're missing a Runtime 5.0 dependency it means you're probably targeting the wrong framework. You should target .Net Framework 3.5
Last edited by Chaos; 1 Apr, 2021 @ 4:33pm
Chaos 1 Apr, 2021 @ 4:42pm 
One more note:

Issue 9 does not recommend you copy Harmony locally or rename its folder. This is not necessary.

Folder renaming is used to test if a mod is affected. The error happens only in specific circumstances, and the "test your mod" section is a recipe of how to reproduce such a specific circumstance, ie, how to induce a failure of a mod which is already broken.

The same failure-inducing circumstances should not cause a failure in a non-broken mod. Ie, you can use the same test to reliably verify if your mod is susceptible.
OldBlueBen 1 Apr, 2021 @ 6:43pm 
Thanks, I had a couple of misconceptions there. lol
< >
Showing 1-3 of 3 comments
Per page: 1530 50

All Discussions > Cities Skylines > Topic Details