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

查看:795
本文介绍了错误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()

推荐答案

经过大量时间和研究,试图解决此问题后,我找到了一个对我有用的解决方案. 我将msbuild与/m和/p:BuildInParallel = true一起使用,并且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/

This is a good reference: https://blogs.msdn.microsoft.com/msbuild/2007/04/16/node-reuse-in-multiproc-msbuild/

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

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