मैं एक कार्यक्रम मोनोविधानसभा
संकलित कमांड के साथ पुस्तकालय 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
मैंने पहले कभी मोनो का उपयोग नहीं किया है, और मुझे पता नहीं है कि क्या हो रहा है .. लेकिन शायद इसका मतलब है कि डीएलएल का उपयोग नहीं किया जा सकता है क्योंकि इसे मोनो के साथ भी संकलित नहीं किया गया है? अगर ऐसी बात है तो; क्या इसका मतलब यह है कि मैं मोनो के साथ किसी भी 3 डी पार्टी डीएलएल का उपयोग नहीं कर सकता जब तक कि मेरे पास स्रोत कोड भी न हो?
धन्यवाद, कि खिड़कियों पर ठीक काम किया! एक असंबंधित नोट पर, लिनक्स sais 'इस ऐप द्वारा समर्थित रनटाइम संस्करण अनुपलब्ध है, डिफ़ॉल्ट रनटाइम v1.1.4322 का उपयोग करके' लेकिन यह एक अलग समस्या की तरह दिखता है। जब मैं कर सकता हूं तो जवाब स्वीकार करूंगा। – natli
क्या आपने इस धागे की जांच की है: http://stackoverflow.com/questions/5327672/running-net-4- appplication-with-mono – Tarik
हाँ, ऐसा लगता है कि 'apt-get इंस्टॉल मोनो-पूर्ण' स्थापित संस्करण 2.6.7 कहां है मुझे .NET 4.0 के लिए कम से कम 2.8 की आवश्यकता है ... ऐसा लगता है कि मुझे स्रोत से 2.10 इंस्टॉल करना है .. बाह। हालांकि धन्यवाद! – natli