在Plugins目錄下導入LitJson.dll文件后,系統提示
Internal compiler error. See the console log for more information. output was:
Unhandled Exception: System.TypeLoadException: Could not load type 'System.Runtime.Versioning.TargetFrameworkAttribute' from assembly 'LitJSON'.
at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0
at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0
經過調試發現造成錯誤的是在Editor目錄下的CS文件,無論CS文件內容是什么只要是.cs擴展名的文件存在Editor目錄下系統就會報錯。
懷疑是Editor目錄下如果有.cs文件u3d就會加載某系程序集,而就是這個程序集與LitJson.dll的程序集沖突。
不完美的解決方法,將Editor 目錄下的.cs文件刪除掉或者將其改為js文件。
將繼續探索解決之道。
終極解決方法就是將Litjson的版本降低。