I made a game that uses c# dll to log data in certain format.
While I’m developing and using the editor, I can perfectly use dll and call methods from it.
But once built, the game acts as like there is no dll in the Build Game Folder but there is. And after the first line of code that uses methods from the dll, it crashes.
Can you provide a possible reason or just point me to a solution?
Bumping for justice.
Has anybody had similar problems with dll’s as this.
Once more, while debugging I can use the dll, but once compiled its just not recognized even if t is in the compiled folder with the exe file?
If I wrap the first DLL method call in try/catch i get this error, maybe it sheds some light on this problem.
System.TypeLoadException: Could not load type ‘System.Configuration.ApplicationSettingsBase’ from assembly ‘System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’.
at DataLogger.SetupUnisensRoundDataCsvFile (System.String fileName) [0x0000c] in C:\Users\Public\Documents\dev\unity_proj\auction_game_diag\Assets\Scripts\Tools\DataLogger.cs:170
(Filename: C:/BuildAgent/work/842f9557127e852/Runtime/ExportGenerated/StandalonePlayer/UnityEngineDebug.cpp Line: 34)
#^@$!!!
It was the option in the Build Player Options. Aparently Unity comes with default .NET 2.0 Subset value for the Api Compatibility, and this causes problems. You need to put it to .NET 2.0.
Build Settings > Player Settings > Api Compatibility Level > Set to .NET 2.0 (not .NET 2.0 Subset as Unity’s default value)