KSPModdingLibs / KSPCommunityFixes

Community patches for bugs in the KSP codebase.
https://github.com/KSPModdingLibs/KSPCommunityFixes/releases/latest
57 stars 19 forks source link

KSP explodes on loading when a dll with no version number is in GameData #111

Closed JonnyOThan closed 1 year ago

JonnyOThan commented 1 year ago

It freezes on "loading part upgrades" and this error will be in the logs:

[EXC 20:47:01.256] ArgumentNullException: Value cannot be null. Parameter name: input System.Version.Parse (System.String input) (at

<9577ac7a62ef43179789031239ba8798>:0) System.Version..ctor (System.String version) (at <9577ac7a62ef43179789031239ba8798>:0) AssemblyLoader.LoadPluginInfo (System.IO.FileInfo file, System.String url, ConfigNode assemblyNode) (at <106570632fc343a784fad39e75e877bf>:0) GameDatabase+d__90.MoveNext () (at <106570632fc343a784fad39e75e877bf>:0) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at :0) UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) d__71:MoveNext() UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) GameDatabase:StartLoad() d__11:MoveNext() UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) LoadingScreen:Start()
gotmachine commented 1 year ago

Yeah. This is an old issue introduced with 1.12. We can't do anything about it in a plugin, as the stock code path involved runs way before plugins are loaded.

Back in the days, when there was also the "duplicated dll crash loading" 1.12 issue (that was fixed in 1.12.2 or 1.12.3, not sure), I made a BepInEx plugin to fix both bugs. But this require installing BepInEx, which comes with a whole bunch of other side issues and annoyances. See https://github.com/gotmachine/StuckOnLoadingPartUpgradesFix

gotmachine commented 1 year ago

For reference, see also https://github.com/KSPModdingLibs/KSPCommunityFixes/issues/103