Json.NET doesn't work with Mono under Debian

2019-07-17 21:07发布

问题:

i'm making an application with C# and Mono framework (to make it compatible on Linux).

In this app i'm using also using the Json.NET library, but seems to not work with Mono because every time i try to start the application i get this error:

Missing method .ctor in assembly /root/igloo/Newtonsoft.Json.dll, type System.Runtime.CompilerServices.ExtensionAttribute
Can't find custom attr constructor image: /root/igloo/Newtonsoft.Json.dll mtoken: 0x0a000077
[20/03/14 06:11:50] System.UnhandledExceptionEventArgs
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'Newtonsoft.Json'.
  at Igloo.Core.Main (System.String[] args) [0x00000] in <filename unknown>:0

Why this happens? I'm using mono-complete (version 2.10) and Debian 7 64bit.