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。如果可能,请帮忙解决。谢谢,David。
编辑
<?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。