TeamCity : The process cannot access the file because it is being used by another process中的NuGet错误

标签 nuget teamcity

我们正在使用TeamCity(9.0)作为CI服务器来构建,测试和部署多个应用程序。最近,我们偶尔会遇到(每30/40个版本中的一个)NuGet(2.8.3)错误,如下所示:

[restore] The process cannot access the file 'C:\BuildAgent\work\e32cbd0940f38bf.....\packages\Newtonsoft.Json.5.0.6\Newtonsoft.Json.5.0.6.nupkg' because it is being used by another process.



实际的包装似乎有时会有所不同。

我们怀疑它与在同一解决方案中多个项目中引用的同一程序包有关,但是我希望NuGet能够通过过滤出重复项而不是尝试多次检索同一程序包来正确处理此问题,从而结束将程序包还原到工作文件夹时,会出现写锁。

作为每个构建配置的第一步,我们将“NuGet安装程序”步骤设置为“恢复”。我尝试摆弄它的设置(不同的“更新模式”,“-NoCache”,较旧的NuGet版本(2.8.0)),但无济于事。

其他人是否遇到过类似的问题,如果是,则对如何确保不会发生此错误有任何建议。

任何帮助将不胜感激!

最佳答案

我在Jenkins中遇到了相同的问题,并通过在nuget restore命令中添加“-DisableParallelProcessing”来解决了最终问题,该命令类似于:

nuget restore "%WORKSPACE%\Solutions\App\App.sln" -DisableParallelProcessing

关于TeamCity : The process cannot access the file because it is being used by another process中的NuGet错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27701701/

相关文章:

c# - 从 .Net Standard 项目和 Native dll 创建一个 nuget 包

.net - ASPNET编译器错误ASPCONFIG : Could not load file or assembly 'Microsoft.VisualBasic.Activities.Compiler' or one of its dependencies

teamcity - 将参数从 Teamcity(属性)传递到命令行

Teamcity 自定义内部版本号生成器

windows - 将与 Tomcat servlet 容器捆绑在一起的 Teamcity 配置为 Windows 服务

visual-studio - 具有调试和发布功能的 Nuget 包

PowerShell NuGet - "no match was found for the specified search criteria"、 "unable to find dependent packages"等

c++ - 我可以将 VS C++ 项目生成的 DLL/EXE 工件存储在 NuGet 包中吗?

nuget - 我还不知道的 TFS NuGet 技巧?

java - 我如何在 teamcity 上发布 gradle 来发布使用 Maven 插件的 gradle 构建?