nuget - 构建项目 - Nuget 错误

标签 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>

Nuget.exe 不存在

检查 .nuget 文件夹,.exe 在目录中! 查看windows的Path,有!

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

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

完整错误:

Error 1 The system cannot find the path specified. CreditoImobiliarioBB.Domain

Error 2 The command ""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\ " " exited with code -1. CreditoImobiliarioBB.Domain

注意事项

只有具有本地包的项目(来源是 key="Bind Solution"value="W:\Cloud\Dropbox\Bind Defaults\Nuget Repository")才会有麻烦。最近,包的位置移动到另一个目录(在本例中为 W:\Cloud\Dropbox\Bind Defaults\Nuget Repository)。

最佳答案

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

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

希望对您有所帮助。

关于nuget - 构建项目 - Nuget 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18209071/

相关文章:

cmd - Chocolatey Ngrok.portable 不工作

c# - 将调试信息嵌入到构建中不包含任何调试符号

c# - Nuget 包内容文件未复制到 .NET Core 项目

visual-studio - 更新后管理 NUGET 包菜单丢失

version-control - Nuget - 在源代码管理中存储包,还是不?

jquery - 无法添加或更新 NuGet 包,收到 NuGet V2 源错误

c# - 我的 NuGet 包与 .NET Core 兼容吗?

NuGet 返回 503 服务器不可用

asp.net - 在 App_Start 中编辑 MiniProfiler.cs 后更新 MiniProfiler.MVC3 NuGet 包

在 Visual Studio Team Services 构建中,Nuget 还原包开始失败