This object is in archive! 
[1.194][ModSDK] ModSDK Build tries to load Workshop Mods from wrong location
Solved
Hello there,
Due to the currently ongoing issue with AMD CPUs I am using the ModSDK build of the game for playing. And I noticed some odd behavior when connecting to Dedicated servers running mods.
I get error like this after connecting to Servers:
2020-03-23 20:16:57.345 - Thread: 1 -> MyScriptManager.LoadData() - START 2020-03-23 20:16:58.588 - Thread: 1 -> MOD_ERROR: TorchMod 2020-03-23 20:16:58.588 - Thread: 1 -> in file: 2020-03-23 20:16:58.588 - Thread: 1 -> Compilation of C:\Users\Martin\AppData\Roaming\SpaceEngineers\Mods\1406994352.sbm_TorchMod failed: 2020-03-23 20:16:58.589 - Thread: 1 -> MOD_ERROR: TorchMod 2020-03-23 20:16:58.589 - Thread: 1 -> in file: 2020-03-23 20:16:58.589 - Thread: 1 -> (1,0): Error: Error writing to XML documentation file: Value must be positive. Parameter name: count 2020-03-23 20:16:58.596 - Thread: 1 -> ASSERT: (1,0): Error: Error writing to XML documentation file: Value must be positive. Parameter name: count at Sandbox.Game.World.MyScriptManager.Compile(IEnumerable`1 scriptFiles, String assemblyName, Boolean zipped, MyModContext context) at Sandbox.Game.World.MyScriptManager.LoadScripts(String path, MyModContext mod) at Sandbox.Game.World.MyScriptManager.LoadData() at Sandbox.Game.World.MySession.PrepareBaseSession(MyObjectBuilder_Checkpoint checkpoint, MyObjectBuilder_Sector sector) at Sandbox.Game.World.MySession.LoadMultiplayer(MyObjectBuilder_World world, MyMultiplayerBase multiplayerSession) at Sandbox.Graphics.GUI.MyGuiScreenBase.RunLoadingAction() at Sandbox.Game.Gui.MyGuiScreenLoading.RunLoad() at Sandbox.Game.Gui.MyGuiScreenLoading.Update(Boolean hasFocus) at Sandbox.Graphics.GUI.MyScreenManager.Update(Int32 totalTimeInMS) at Sandbox.Graphics.GUI.MyDX9Gui.Update(Int32 totalTimeInMS) at Sandbox.Graphics.GUI.MyGuiSandbox.Update(Int32 totalTimeInMS) at Sandbox.MySandboxGame.Update() at Sandbox.Engine.Platform.Game.UpdateInternal() at Sandbox.Engine.Platform.Game.RunSingleFrame() at Sandbox.Engine.Platform.FixedLoop.<>c__DisplayClass11_0.<Run>b__0() at Sandbox.Engine.Platform.GenericLoop.Run(VoidAction tickCallback) at Sandbox.Engine.Platform.FixedLoop.Run(VoidAction tickCallback) at Sandbox.Engine.Platform.Game.RunLoop() at Sandbox.MySandboxGame.Run(Boolean customRenderLoop, Action disposeSplashScreen) at SpaceEngineers.MyProgram.Main(String[] args) 2020-03-23 20:16:58.624 - Thread: 1 -> MyScriptManager.LoadData() - ENDTook me a while to figure out but
C:\Users\Martin\AppData\Roaming\SpaceEngineers\Mods\1406994352.sbm_TorchMod
Is the incorrect place to load mods from. I believe 2 Builds ago the default Workshop Location for mods was changed to the Steam Library
G:\SteamLibrary\steamapps\workshop\content\244850\1406994352\Data\Scripts\TorchMod
According to the Logs
2020-03-23 20:16:55.691 - Thread: 1 -> LoadSession() - Start 2020-03-23 20:16:55.701 - Thread: 14 -> Downloading world mods - START 2020-03-23 20:16:55.706 - Thread: 14 -> MyWorkshop.GetItemsBlocking: getting 1 items 2020-03-23 20:16:56.114 - Thread: 1 -> Mod query successful 2020-03-23 20:16:56.123 - Thread: 14 -> Up to date mod: Id = 1406994352, title = 'TorchMod' 2020-03-23 20:16:56.124 - Thread: 14 -> Mod download time: 0.01 seconds 2020-03-23 20:16:56.126 - Thread: 14 -> Downloading world mods - END 2020-03-23 20:16:56.139 - Thread: 1 -> get 2020-03-23 20:16:56.141 - Thread: 1 -> MyConfig.Save() - START 2020-03-23 20:16:56.141 - Thread: 1 -> Path: C:\Users\Martin\AppData\Roaming\SpaceEngineers\SpaceEngineers.cfg 2020-03-23 20:16:56.173 - Thread: 1 -> MyConfig.Save() - ENDThe Mod was marked as up to date in the steam library
and then tries to load it from the APPDATA folder which will obviously fail for the Mod not being there.
Please fix :-)
I have spent the evening debugging the game via dnSpy and some help from Inflex to figure out where it came from.
First of all the game loads Mods from the correct location, its just the Log-Message thats wrong and confusing.
However the cause for the Mods not loading is actually invalid Documentation.
The difference is that the ModSDK build also emits PDB files for Debugging. Which for some reason also causes Roselyn to write XML Documentation.
PDB Files are super useful, XML Doku probably not. I tested a Modded server and it failed to load almost all mods with the the same error.
So all of these Mods have an invalid documentation.
Maybe its possible to configure Roselyn to not take care of documentation? Dunno
The exact Excetpion is an ArgumentOutOfRange when parsing Documentation (See Screenshots)
I also attached a test mod that will fail when being loaded via ModSDK Build but run fine on regular Build.
I have spent the evening debugging the game via dnSpy and some help from Inflex to figure out where it came from.
First of all the game loads Mods from the correct location, its just the Log-Message thats wrong and confusing.
However the cause for the Mods not loading is actually invalid Documentation.
The difference is that the ModSDK build also emits PDB files for Debugging. Which for some reason also causes Roselyn to write XML Documentation.
PDB Files are super useful, XML Doku probably not. I tested a Modded server and it failed to load almost all mods with the the same error.
So all of these Mods have an invalid documentation.
Maybe its possible to configure Roselyn to not take care of documentation? Dunno
The exact Excetpion is an ArgumentOutOfRange when parsing Documentation (See Screenshots)
I also attached a test mod that will fail when being loaded via ModSDK Build but run fine on regular Build.
Replies have been locked on this page!