Nuget包没有安装

时间:2018-01-24 19:20:31

标签: c# nuget owin

我正在尝试在一个项目中安装owin并且它失败并出现以下错误并不是真正描述性的。如果我创建一个新项目,它的工作正常。如何找出导致错误的原因

我使用-verbose进行了更新,但没有额外的信息

Adding package 'Microsoft.AspNet.Identity.Core.2.2.1' to folder 'c:\Workspace\Ruby\pfg.producealliance.com\packages'
Install failed. Rolling back...
Package 'Microsoft.AspNet.Identity.Core.2.2.1' does not exist in project 'Ruby.Web'
Removing package 'Microsoft.AspNet.Identity.Core.2.2.1' from folder 'c:\Workspace\Ruby\pfg.producealliance.com\packages'
TF400024: The change on c:\Workspace\Ruby\pfg.producealliance.com\packages\Microsoft.AspNet.Identity.Core.2.2.1\Microsoft.AspNet.Identity.Core.2.2.1.nupkg cannot be undone because a file already exists at c:\Workspace\Ruby\pfg.producealliance.com\packages\Microsoft.AspNet.Identity.Core.2.2.1\Microsoft.AspNet.Identity.Core.2.2.1.nupkg. The file must be deleted from disk for the undo to succeed.
Install-Package : TF400024: The change on c:\Workspace\Ruby\pfg.producealliance.com\packages\Microsoft.AspNet.Identity.Core.2.2.1\Microsoft.AspNet.Identity.Core.2.2.1.nupkg cannot be undone because a file already exists at 
c:\Workspace\Ruby\pfg.producealliance.com\packages\Microsoft.AspNet.Identity.Core.2.2.1\Microsoft.AspNet.Identity.Core.2.2.1.nupkg. The file must be deleted from disk for the undo to succeed.
At line:1 char:1
+ Install-Package Microsoft.AspNet.Identity.Owin -ProjectName Ruby.Web  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

1 个答案:

答案 0 :(得分:0)

  

如何找出导致错误的原因[?]

-Verbose标记传递给Install-Package。输出有望更准确地告诉您出了什么问题。也许文件正在使用中,无法复制或修改?

更新: 感谢OP提供的额外信息,我认为Nuget Package updates & Package.config remove issue (TF400024)可以解答您的问题(提示:它与您的项目没有从源代码管理中检出)有关。查看项目,然后重试。