2013-09-24 38 views
3

Xamarin的我有Indie license,這樣我就可以用我最熟練的編程語言C#開發iPhone/iPad應用程序。有了這個許可證,我不能使用Xamarin的Visual Studio插件。我仍然喜歡Visual StudioXamarin Studio,所以我仍然在Visual Studio上開發任何代碼,不需要MonoTouch引用,然後只需手動將dll複製到Xamarin Studio無法加載Json.NET DLL Xamarin Studio

我有一個組件.NET框架4.5,當我試圖調試我的應用程序,得到以下錯誤信息:

加載的程序集:/Users/EdGriMac/Dropbox/Quiz/Newtonsoft.Json。 dll [External] 2013-09-23 20:30:38.021 Exam936 [2228:c07]無法加載'Newtonsoft.Json'進行註冊: System.Reflection.ReflectionTypeLoadException:無法加載模塊中的類。 (包裝託管到本機)System.Reflection.Assembly:GetTypes (System.Reflection.Assembly,bool) at System.Reflection.Assembly.GetTypes()[0x00000] in /Developer/MonoTouch/Source/MonoTouch.Registrar.OldDynamicRegistrar.RegisterAssembly (System.Reflection.Assembly a)[0x00000] in /Developer/MonoTouch/Source/monotouch/src下的mono/mcs/class/corlib/System.Reflection/Assembly.cs:351 /ObjCRuntime/OldDynamicRegistrar.cs:67 2013-09-23 20:30:38.023 Exam936 [2228:c07]這可能是由於模擬器保存了過時的程序集,位置: /Users/EdGriMac/Dropbox/Quiz/Newtonsoft.Json.dll

我嘗試:

  1. 是彈簧想到的是,NewtonSoft.Json不能MonoTouch的使用,但我不知道怎麼找出來的第一件事。有沒有辦法確定是否可以使用第三方DLL?

  2. 我的第二個想法是NewtonSoft.Json的舊版本或更新版本可能被其他程序集使用。然而,這不是一個大型項目,我唯一使用的其他程序集JsonRestSharp,但我不認爲它使用NewtonSoft.Json。我查看了他們的GitHub頁面的網頁,但無法找到參考。

  3. 我用Google搜索了一下,發現this post說,(有些低落)MonoTouch.Registrar.OldDynamicRegistrar.RegisterAssembly表明(報價:) I can't build the app using the build flags --registrar:olddynamic. If I remove that, it now works, I can now link and it appears to be working..這可能是Visual Studio的設置,當你有一個Business license可以調整。我不知道如何沒有這些標誌。

正在嘗試做什麼?如果是,我該怎麼辦?

在此先感謝!

+0

直接安裝從Xamarin組件商店獲取Json.Net版本。它只是工作。 –

+0

掃描此程序集使用http://scan.xamarin.com/如你在我的其他問題(http:// stackoverflow。com/questions/18980512 /如何找到 - 如果程序集可以使用通過單擊/ 18980843#18980843)向我表明'NewtonSoft.Json'只有90%兼容。今天晚些時候我會嘗試你的替代品。 – Halvard

回答

5

Xamarin組件商店(http://components.xamarin.com/view/json.net/)的Json.NET版本正常工作。並從Xamarin Studio

+0

我不太明白爲什麼,但正如你所說,它只是起作用。 – Halvard

+0

,因爲有人花時間去適應它,因此它與monoTouch中提供的.NET配置文件兼容。 –

+0

這不再是5.1的情況(內部版本479) – Mason240