Moving to JSON.NET 4.0.3 broke my app

对着背影说爱祢 提交于 2019-12-20 06:56:08

问题


I have a Windows Phone 7.1 (Mango) application that was using JSON.NET 4.0.2.

I upgraded it to 4.0.3 and now I get all kinds of error.

A deserialized class that was working before is now throwing this error : Could not load type 'System.Dynamic.IDynamicMetaObjectProvider' from assembly 'System.Core, Version=3.7.0.0, Culture=neutral, PublicKeyToken=969DB8053D3322AC'.

I also make use of the Linq feature by using JArray and now I get this message: {"Could not load type 'Newtonsoft.Json.Linq.JArray' from assembly 'Newtonsoft.Json, Version=4.0.3.0, Culture=neutral, PublicKeyToken=30AD4FE6B2A6AEED'."}

I tried cleaning the solution. I tried copying the DLLs one more time.

Any suggestions?


回答1:


The problem is that Windows Phone 7.1 defaults to the Silverlight 4 build if no explicit Silverlight 4 WP build is specified. Silverlight 4 has features that aren't available on WP which is why this causes Json.NET to break.

This will be fixed in 4.0.5 by having the current Windows Phone 7.0 dll used for 7.1 but for now to fix the problem just change the dll reference to the Newtonsoft.Json.dll file in the sl3-wp directory.



来源:https://stackoverflow.com/questions/7780389/moving-to-json-net-4-0-3-broke-my-app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!