簡體   English   中英

將Json.Net安裝到針對Windows Phone 7的項目時出錯

[英]Error when installing Json.Net to a project targeting Windows Phone 7

我嘗試使用命令install-package newtonsoft.json通過NuGet install-package newtonsoft.json

我收到了如下所示的錯誤。 我該如何解決?

Install-Package Newtonsoft.Json
Installing 'Newtonsoft.Json 6.0.6'.
Successfully installed 'Newtonsoft.Json 6.0.6'.
Removing 'Newtonsoft.Json 6.0.3' from ReadJSON.
Successfully removed 'Newtonsoft.Json 6.0.3' from ReadJSON.
Adding 'Newtonsoft.Json 6.0.6' to ReadJSON.
Uninstalling 'Newtonsoft.Json 6.0.6'.
Successfully uninstalled 'Newtonsoft.Json 6.0.6'.
Install failed. Rolling back...
Install-Package : Could not install package 'Newtonsoft.Json 6.0.6'. You are trying to install this package into a project that 
targets 'Silverlight,Version=v4.0,Profile=WindowsPhone71', but the package does not contain any assembly references or content 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

從Json.Net 6.0版( )中刪除了對Windows Phone 7和Silverlight 4的支持。 如果仍然需要定位WP7 / SL4,則需要使用Json.Net v5.0.8。 您可以通過在軟件包管理器控制台中使用以下命令來安裝它:

Install-Package Newtonsoft.Json -Version 5.0.8

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM