构建项目 - Nuget Error

rid*_*nsb 3 nuget nuget-package

该错误仅在一台机器上发生.

尝试

错误的路径

我认为任何来源的路径都可能是错误的,所以我打开了NuGet.Config检查,3条路径是正确的!

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageRestore>
    <add key="enabled" value="True" />
  </packageRestore>
  <packageSources>
    <add key="NuGet official package source" value="https://nuget.org/api/v2/" />
    <add key="Nightly ASP.NET Web Stack" value="http://www.myget.org/F/aspnetwebstacknightly/" />
    <add key="Bind Solution" value="W:\Cloud\Dropbox\Bind Defaults\Nuget Repository" />
  </packageSources>
  <disabledPackageSources />
  <activePackageSource>
    <add key="NuGet official package source" value="https://nuget.org/api/v2/" />
  </activePackageSource>
</configuration>
Run Code Online (Sandbox Code Playgroud)

Nuget.exe不存在

检查.nuget文件夹和.exe是在目录中!检查窗口的路径,有!

我试图手动运行命令,它运行成功!

nuget install packages.config -source "" -NonInteractive -RequireConsent -solutionDir "W:\C lients\creditoimobiliariobb\sistema\src\CreditoImobiliarioBB\ "

完整错误:

错误1系统找不到指定的路径.CreditoImobiliarioBB.Domain

错误2命令""W:\ Clients\creditoimobiliariobb\sistema\src\CreditoImobiliarioBB.nuget\NuGet.exe"install"W:\ Clients\creditoimobiliariobb\sistema\src\CreditoImobiliarioBB\CreditoImobiliarioBB.Model\packages.config"-source " - -NonInteractive -RequireConsent -solutionDir"W:\ Clients\creditoimobiliariobb\sistema\src\CreditoImobiliarioBB \""以代码-1退出.CreditoImobiliarioBB.Domain

注意事项

只有拥有本地软件包(Source is key="Bind Solution" value="W:\Cloud\Dropbox\Bind Defaults\Nuget Repository")的项目才有问题.最近,包的位置移动到另一个目录(在本例中为W:\Cloud\Dropbox\Bind Defaults\Nuget Repository).

小智 5

我最近遇到了类似的问题,我通过这样做解决了这个问题:

  1. 将Visual Studio更新到最新版本.(扩展和更新 - 产品更新)
  2. 将Nugget更新到最新版本.(扩展和更新 - Visual Studio库)
  3. 清除包缓存.(选项 - 包管理器)
  4. 重建解决方案.

希望能帮助到你.

  • +1 - >我刚刚结束清理缓存并且工作正常. (2认同)