这个错误只在一台机器上发生。
尝试
错误的路径
我认为任何源的路径可能都是错误的,所以我打开了 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>
Nuget.exe文件不存在
检查了.nuget
文件夹,发现.exe文件在目录中!
在Windows路径中进行了检查,也找到了该文件!
我尝试手动运行命令,结果成功运行!
nuget install packages.config -source "" -NonInteractive -RequireConsent -solutionDir "W:\Clients\creditoimobiliariobb\sistema\src\CreditoImobiliarioBB\ "
完整错误信息:
Error 1 系统找不到指定的路径。 CreditoImobiliarioBB.Domain
Error 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
注意事项
只有具有本地软件包(源为key="Bind Solution" value="W:\Cloud\Dropbox\Bind Defaults\Nuget Repository"
)的项目会遇到问题。最近软件包的位置已经移动到另一个目录(在这种情况下是W:\Cloud\Dropbox\Bind Defaults\Nuget Repository
)。