错误 MSB4166:子节点过早退出.关机 [英] error MSB4166: Child node exited prematurely. Shutting down

查看:22
本文介绍了错误 MSB4166:子节点过早退出.关机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时我的构建会因此错误而失败.

Sometimes my build fail with this error.

 0>MSBUILD : error MSB4166: Child node "3" exited prematurely. Shutting down.

它似乎是完全随机的,我无法随意复制它.我正在运行 VS2010 Win7 x64 MSBuild 4.0,但这个问题似乎与平台和操作系统无关.我正在并行构建解决方案(/m switch + BuildInParallel=True),我不想禁用此功能,因为我正在编译包含 800+ 个项目的应用程序.知道如何解决吗?

It seems to be completely random and I've not been able to reproduce it at will. I'm running VS2010 Win7 x64 MSBuild 4.0 but this problem seems to be platform and OS independent. I'm building solutions in parallel (/m switch + BuildInParallel=True) and I don't want to disable this feature because I'm compiling application containing 800+ projects . Any idea how to solve it?

当我安装 .NET 4.5 开发人员预览版时,错误日志记录在 MSBuild 4.5 中得到了改进,现在错误字符串如下所示:

When I installed .NET 4.5 developer preview, error logging was improved in the MSBuild 4.5 and now the error string looks like this:

error MSB4166: Child node "3" exited prematurely. Shutting down. Diagnostic information may be found in files in the temporary files directory named MSBuild_*.failure.txt

我可以在 Temp 文件夹中找到错误日志文件.这是 MSBuild_*.failure.txt 文件的内容:

I can find error log file in the Temp folder. This is content of MSBuild_*.failure.txt file:

System.InvalidOperationException: BuildEventArgs has formatted message while serializing!
   at Microsoft.Build.Framework.LazyFormattedBuildEventArgs.WriteToStream(BinaryWriter writer)
   at Microsoft.Build.Framework.BuildMessageEventArgs.WriteToStream(BinaryWriter writer)
   at Microsoft.Build.Shared.LogMessagePacketBase.WriteToStream(INodePacketTranslator translator)
   at Microsoft.Build.BackEnd.NodeEndpointOutOfProcBase.PacketPumpProc()

推荐答案

经过大量时间和研究试图解决这个问题,我找到了一个适合我的解决方案.我正在使用带有/m 和/p:BuildInParallel=true 的 msbuild,并且构建在 CI 服务器中失败.它总是在第二个组件中失败并出现错误:

After a lot of time and research trying to fix this problem I found a solution that worked for me. I am using msbuild with /m and /p:BuildInParallel=true and the build was failing in the CI server. It was always failing in the second componen with the error:

错误 MSB4166:子节点3"过早退出.正在关机.

error MSB4166: Child node "3" exited prematurely. Shutting down.

添加/nodeReuse:false 解决了问题.

Adding /nodeReuse:false fixed the problem.

这是一个很好的参考:https://blogs.msdn.microsoft.com/msbuild/2007/04/16/node-reuse-in-multiproc-msbuild/

这篇关于错误 MSB4166:子节点过早退出.关机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆