如何通过nuget为Windows Phone 7.1和Silverlight v.4,0正确安装Json.net

MyW*_*Way 2 c# silverlight json.net windows-phone-7.1

我需要使用json.net进行json序列化和反序列化,但是我遇到了安装此软件包的问题.正如我在网站上看到的, 它支持wp 7.1和silverilight.当我在控制台中输入时Install-Package Newtonsoft.Json

Installing 'Newtonsoft.Json 6.0.1'.
Successfully installed 'Newtonsoft.Json 6.0.1'.
Adding 'Newtonsoft.Json 6.0.1' to Connected.
Uninstalling 'Newtonsoft.Json 6.0.1'.
Successfully uninstalled 'Newtonsoft.Json 6.0.1'.
Install failed. Rolling back...
Install-Package : Could not install package 'Newtonsoft.Json 6.0.1'. You are trying to install this package into a project tha
t targets 'Silverlight,Version=v4.0,Profile=WindowsPhone71', but the package does not contain any assembly references or conte
nt files that are compatible with that framework. For more information, contact the package author.
At line:1 char:1
+ Install-Package Newtonsoft.Json
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
Run Code Online (Sandbox Code Playgroud)

如何解决这个问题?怎么做得好?

小智 5

使用Windows Phone 7,您应该安装该软件包的旧版本,例如5.0.1.你可以做Install-package Newtonsoft.Json -version 5.0.1