These are test results for what happens in various cases when multiple copies of Harmony exist in GameData of Kerbal Space Program, e.g. caused by multiple mods bundling their own copy.
One question relates to which copy (or copies) get loaded and used by the respective mods that bundled them. This may affect the choice between whether individual mods should bundle their own copy of Harmony, or list it as a dependency to be obtained separately. See: KSP-CKAN/NetKAN#7131
It was also unclear whether having multiple copies in KSP in this manner might lead to problems. Per Harmony#102 while it worked without a hitch in RimWorld, it did cause issues for Cities: Skylines.
Three slightly modified versions of HarmonyUser.cs
are made and compiled, differing in only the class name, AssemblyTitle
and the assembly name (*.dll file name). These are packaged as three different "mods" with slightly different layouts:
GameData
+ TestA
+ 0Harmony-A.dll
+ harmonytestA.dll
GameData
+ TestB
+ Harmony
| + 0Harmony-B.dll
+ harmonytestB.dll
GameData
+ 0Harmony
| + 0Harmony-C.dll
+ TestC
+ harmonytestC.dll
All three mods are installed at the same time on a copy of KSP 1.7.0.
However, the actual versions of Harmony bundled with each mod varies.
We test three different scenarios:
0Harmony-A.dll
is v1.2.0.1
the other two are v1.1.1.0 / v1.1.1
0Harmony-B.dll
is v1.2.0.1
the other two are v1.1.1.0 / v1.1.1
0Harmony-C.dll
is v1.2.0.1
the other two are v1.1.1.0 / v1.1.1
Logs ScenarioA.log
, ScenarioB.log
& ScenarioC.log
below.
The newest version of Harmony is always used, and all mods use the same copy.