我正在尝试编译一个使用Newtonsoft.Json.dll
带有单声道的库的程序
编译命令
gmcs Program.cs etcetera.cs -r:Newtonsoft.Json.dll -r:Argotic.Core.dll
结果:
Missing method .ctor in assembly Newtonsoft.Json.dll, type System.Runtime.Versioning.TargetFrameworkAttribute
Can't find custom attr constructor image: Newtonsoft.Json.dll mtoken: 0x0a000053
然后当试图运行程序 ( mono Program.exe
) 时,它会抛出错误:
Unhandled Exception: System.TypeLoadException: Could not load type 'System.Runtime.Versioning.TargetFrameworkAttribute' from assembly 'Newtonsoft.Json'.
at my_program.CJSONStuff.serialize (System.Collections.Generic.Dictionary`2 obj) [0x00000] in <filename unknown>:0
at my_program.TheObjDB.getAllSerialized () [0x00000] in <filename unknown>:0
at my_program.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'System.Runtime.Versioning.TargetFrameworkAttribute' from assembly 'Newtonsoft.Json'.
at my_program.CJSONStuff.serialize (System.Collections.Generic.Dictionary`2 obj) [0x00000] in <filename unknown>:0
at my_program.TheObjDB.getAllSerialized () [0x00000] in <filename unknown>:0
at my_program.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
我以前从未使用过单声道,也不知道发生了什么.. 但这可能意味着 DLL 无法使用,因为它还没有使用单声道编译?如果是这样的话;这是否意味着我不能使用任何带有单声道的 3d 方 DLL,除非我也有源代码?