无法使用VS2015安装/更新任何nuget软件包

时间:2016-08-01 13:31:42

标签: visual-studio-2015 nuget

我遇到了一个问题,我无法安装任何NugetPackages。这包括更新现有的软件包,它将删除旧软件包并且无法安装更新的软件包,使我的解决方案处于破碎状态!

以下是尝试安装SpecFlow时Package Manager控制台输出的示例:

PM> Install-Package SpecRun.SpecFlow -verbose
  GET http://path:to/nugetserver/api/nuget/nuget-repos/FindPackagesById()?id='SpecRun.SpecFlow'
  OK http://path:to/nugetserver/api/nuget/nuget-repos/FindPackagesById()?id='SpecRun.SpecFlow' 780ms
Attempting to gather dependency information for package 'SpecRun.SpecFlow.1.5.2' with respect to project 'Framework\MyService.Data', targeting '.NETFramework,Version=v4.5.1'
Attempting to resolve dependencies for package 'SpecRun.SpecFlow.1.5.2' with DependencyBehavior 'Lowest'
Resolving actions to install package 'SpecRun.SpecFlow.1.5.2'
Resolved actions to install package 'SpecRun.SpecFlow.1.5.2'
For adding package 'SpecFlow.2.1.0' to project 'MyService.Data' that targets 'net451'.
For adding package 'SpecFlow.2.1.0' to project 'MyService.Data' that targets 'net451'.
Adding package 'SpecFlow.2.1.0' to folder 'F:\tfs\MyService\Main\packages'
Added package 'SpecFlow.2.1.0' to folder 'F:\tfs\MyService\Main\packages'
Install failed. Rolling back...
Package 'SpecFlow.2.1.0' does not exist in project 'MyService.Data'
Removing package 'SpecFlow.2.1.0' from folder 'F:\tfs\MyService\Main\packages'
Removed file 'SpecFlow.2.1.0.nupkg' from folder 'F:\tfs\MyService\Main\packages\SpecFlow.2.1.0'.
Removed folder 'F:\tfs\MyService\Main\packages\SpecFlow.2.1.0'.
Removed package 'SpecFlow.2.1.0' from folder 'F:\tfs\MyService\Main\packages'
Install-Package : Failed to add reference to 'TechTalk.SpecFlow'.
At line:1 char:1
+ Install-Package SpecRun.SpecFlow -verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

正如您所看到的,它会下载软件包(我可以看到它出现在packages文件夹中的文件系统中),但它无法安装并从磁盘中删除它。我已经搜索并验证了包文件夹没有意外地签入源控件。这是在我使用Visual Studio 2015打开的任何解决方案上发生的。我尝试过控制台和包管理器GUI,但都失败了。

事情似乎在VS2013中起作用(这是我一直使用的解决方法之一,但不是长期解决方案)。

VS 2015与Nuget完全一致。

由于

0 个答案:

没有答案