如何通过的NuGet正确安装Json.net Windows Phone的7.1和Silverlight v.4,0 [英] how to properly install Json.net via nuget for windows phone 7.1 and Silverlight v.4,0

查看:463
本文介绍了如何通过的NuGet正确安装Json.net Windows Phone的7.1和Silverlight v.4,0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用json.net的JSON序列化和反序列化,但我有这个安装包的问题。正如我在网站上看到支持WP 7.1和silverilight。当我在控制台我打字安装封装Newtonsoft.Json

I need to use json.net for json serialization and deserialization, but I have the problem with installing this package. As I saw on the website it supports wp 7.1 and silverilight. When I'm typing in console 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

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

How to solve this issue ? How it should be properly done ?

推荐答案

随着Windows Phone 7,你应该安装的是旧版本包,例如5.0.1。你可以做安装包Newtonsoft.Json -version 5.0.1

With windows phone 7, you should probably install the older version of that package, such as 5.0.1. You can do Install-package Newtonsoft.Json -version 5.0.1

这篇关于如何通过的NuGet正确安装Json.net Windows Phone的7.1和Silverlight v.4,0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆