私はモノは、アセンブリ
コンパイルコマンドでライブラリNewtonsoft.Json.dll
を使用するプログラムをコンパイルしようとしていますから、型System.Runtime.Versioning.TargetFrameWorkAttributeをロードできませんでした
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を使用できないということですか?
おかげで、!無関係なノートでは、linux sais 'このアプリケーションでサポートされているランタイムバージョンは、デフォルトのランタイムv1.1.4322を使用して利用できませんが、別の問題のように見えます。できれば答える – natli
このスレッドをチェックしましたか:http://stackoverflow.com/questions/5327672/running-net-4-application-with-mono – Tarik
「apt-get install mono-complete」のようにインストールされています。バージョン2.6.7がインストールされています。 .net 4.0のためには少なくとも2.8が必要です...ソースから2.10をインストールする必要があるようです。しかし、ありがとう! – natli