我刚刚在我的PC上安装了Windows 8并下载了适用于Windows 8的Microsoft Visual Studio Express 2012.更新了所有内容,当我尝试通过Package Manager Console安装任何内容时,我收到以下错误:
PM> Install-Package Parse
Attempting to resolve dependency 'Newtonsoft.Json (≥ 4.5.9)'.
Successfully installed 'Newtonsoft.Json 4.5.11'.
Successfully installed 'parse 1.0.5'.
Successfully uninstalled 'Newtonsoft.Json 4.5.11'.
Install failed. Rolling back...
Install-Package : Failed to add reference to 'Newtonsoft.Json'.
At line:1 char:1
+ Install-Package Parse
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
有谁知道如何解决此错误?
谢谢,杰克
答案 0 :(得分:7)
检查您是否已在packages.config中添加了Newtonsoft.Json引用。如果是,请删除Newtonsoft.Json条目并重试Install-Package。
答案 1 :(得分:6)
有时只是从packages.config中删除它可能还不够。在安装完成后,我必须从packages-directory中删除Newtonsoft.Json目录。