So I followed this tutorial here for using Visual Studio (almost ever other tutorial was identical). I followed it precisely and have not missed doing anything (dependencies, code, etc). In fact, I simply copy and pasted the code.
However, when the game loads I get the following error:
A Mod caused an error [ModException]
--------
Details:
System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
at System.Reflection.Assembly.GetExportedTypes () [0x00000] in <filename unknown>:0
at ColossalFramework.Plugins.PluginManager+PluginInfo.GetInstances[IUserMod] () [0x00000] in <filename unknown>:0
at EntryData.GenerateData () [0x00000] in <filename unknown>:0
--------
Looking at the game's output log (see attached), it shows no error at the line my mod is loaded, but further down when loading "(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)" the exception is thrown. However, I know it is my mod that is the issue (as everything works fine without it).
I spent endless hours trying to debug the issue without success. I'm hoping someone with more experience with this particular game using VS could be of some assistance to get me started.
Now the strange thing is, when I simply create a Source folder in my mod folder and copy my source code .cs file over and run the game, the mod works perfectly! So it doesn't appear to be my code.
I just recently got cities: skylines and wanted to start modding it, so I started looking for tutorials. However, I can't even get that to work in order to start working on the mod itself. I need to be able to do this from within Visual Studio.
Any help with getting this to work with VS would be greatly appreciated.
However, when the game loads I get the following error:
A Mod caused an error [ModException]
--------
Details:
System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
at System.Reflection.Assembly.GetExportedTypes () [0x00000] in <filename unknown>:0
at ColossalFramework.Plugins.PluginManager+PluginInfo.GetInstances[IUserMod] () [0x00000] in <filename unknown>:0
at EntryData.GenerateData () [0x00000] in <filename unknown>:0
--------
Looking at the game's output log (see attached), it shows no error at the line my mod is loaded, but further down when loading "(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)" the exception is thrown. However, I know it is my mod that is the issue (as everything works fine without it).
I spent endless hours trying to debug the issue without success. I'm hoping someone with more experience with this particular game using VS could be of some assistance to get me started.
Now the strange thing is, when I simply create a Source folder in my mod folder and copy my source code .cs file over and run the game, the mod works perfectly! So it doesn't appear to be my code.
I just recently got cities: skylines and wanted to start modding it, so I started looking for tutorials. However, I can't even get that to work in order to start working on the mod itself. I need to be able to do this from within Visual Studio.
Any help with getting this to work with VS would be greatly appreciated.