我在输出窗口中收到以下错误:
D:\{solutionPath}\.nuget\nuget.targets(76,9): error :
D:\{solutionPath}\.nuget\nuget.targets(76,9): error : Unhandled Exception: OutOfMemoryException.
D:\{solutionPath}\.nuget\nuget.targets(76,9): error MSB3073: The command ""D:\{solutionPath}\.nuget\nuget.exe" install "D:\{pathToConfigLocation}\packages.config" -source "" -o "D:\{solutionPath}\packages"" exited with code -1.
以上是 NuGet.targets 自带的。
D:\{solutionPath}\.nuget\nuget.targets(76,9): error :
D:\{solutionPath}\.nuget\nuget.targets(76,9): error : Unhandled Exception: OutOfMemoryException.
D:\{solutionPath}\.nuget\nuget.targets(76,9): error MSB3073: The command ""D:\{solutionPath}\.nuget\nuget.exe" install "D:\{pathToConfigLocation}\packages.config" -source "{localPackageDir}" -o "D:\{solutionPath}\packages"" exited with code -1.
与我在 NuGet.targets 中的包源
当构建发生时,它会创建尽可能多的 nuget.exe 进程以耗尽所有内存,然后它会失败并再次尝试。
我已经接受了命令并通过 cmd 运行它。
"D:\{longPah}\.nuget\nuget.exe" install "D:\{longPah}\packages.config" -source "\\{longPah}\NuGetPackages" -o "D:\{longPah}\packages"
这给了我以下错误:
Unhandled Exception: System.IO.FileLoadException: Could not load file or assembl
y 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or
one of its dependencies. Exception from HRESULT: 0x800705AF
at Bootstrapper.Program.Main(String[] args)
我的机器上有.net 4。
如果可以的话请帮忙。
谢谢,大卫
编辑
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Company.Common.Library" version="0.1.2" targetFramework="net35" />
</packages>
packages.config 根据要求。
编辑
我尝试通过 Visual Studio 命令提示符(以管理员身份运行)运行该命令,但它会引发以下异常:
未处理的异常:OutOfMemoryException。
编辑 - 可能的修复
我想我已经找到了问题......它似乎与 .nuget 文件夹中的 nuget.exe 有关。
我有几个解决方案,并找到了几个有效的解决方案,花费大量时间查看文件权限(被告知这是问题所在),然后考虑检查每个解决方案中的 nuget.exe 属性。
在有效的解决方案中,我发现:
在我找不到的解决方案中:
如您所见,两者的文件大小截然不同。所有项目都是由团队中的不同人员添加的,这可能是开发人员机器上安装的 nuget 版本的问题吗?
如果是这样,当您选择为解决方案启用包还原时,是否有人知道哪个版本的 nuget 会导致上述问题?顺便说一句,我的机器上安装了最新版本的 NuGet。