'Child node "2" exited prematurely
I recently retargeted my Windows 8.1 app to Windows 10. I'm getting this error when building the UI projects,
"MSBUILD : error MSB4166: Child node "2" exited prematurely. Shutting down. Diagnostic information may be found in files in the temporary files directory named MSBuild_*.failure.txt."
That's not particularly useful, so I went to %temp% looking for said failure log, and it doesn't exist. Am I looking in the wrong "temp" directory?
What causes this error? I can build my supporting library project without this error.
Solution 1:[1]
Restart Windows resolved it for me. Always worth a try for weird errors like this.
Solution 2:[2]
I repaired the .net framework (control panel -> programs and features.. -> repair) because my assumption was that a dll required for MSBuild is broken. It is working now but I don't know if this is happen randomly or it's all fine.
Solution 3:[3]
I started getting these errors in our C++ project since exactly 11 nov 2016. Checking the windows-updates, it installed the following microsoft updates for windows 10 in the morning:
Update for Windows 10 Version 1511 for x64-based Systems (KB3150513)
https://support.microsoft.com/en-us/kb/3150513
Windows Malicious Software Removal Tool for Windows 8, 8.1, 10 and Windows Server 2012, 2012 R2, 2016 x64 Edition - November 2016 (KB890830)
https://support.microsoft.com/en-us/kb/890830
Cumulative Update for Windows 10 Version 1511 for x64-based Systems (KB3198586)
https://support.microsoft.com/en-us/kb/3198586
Security Update for Adobe Flash Player for Windows 10 Version 1511 (for x64-based Systems) (KB3202790)
https://support.microsoft.com/en-us/kb/3202790
Security Update for Adobe Flash Player for Windows 10 Version 1511 (for x64-based Systems) (KB3201860)
https://support.microsoft.com/en-us/kb/3201860
Disabling multiprocessor compilation /MP (in the project-settings, under C/C++, General) seems to avoid the issue.
For the record: Happened when using incredibuild 7.22. Didn't test if it also occurs without incredibuild.
Solution 4:[4]
For me the error appeared after setting up my build environment on a Windows Server 2012 R2.
I was running multiple MSBuild instances in parallel in the same workspace. Running MSBuild instances sequentially or in different workspaces made the problem go away.
Given other answers, my take is the error message is "something went horribly wrong and crashed violently". MSBuild robustness bug if you ask me.
Solution 5:[5]
In my case it was SlowCheetah, where I set default transform for all "Content" items:
<Content>
<TransformOnBuild>true</TransformOnBuild>
<Link></Link>
<CopyToOutputDirectory></CopyToOutputDirectory>
</Content>
That caused the build to take more and more memory (like 1,7GB) and eventually throw the "child node" message. After restarting windows, my VS 2019 simply closed instead of getting the error on every build. Setting content transform to false solved the problem.
Solution 6:[6]
I got the same error. In my case the MSBuild failure.txt file was present, and listed this error:
System.IO.FileLoadException: Could not load file or assembly 'System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
After trying some of the above options, I stumbled across a bad installation of the Npgsql assemblies into the GAC. Uninstalling Npgsql seems to have fixed the issue. So if none of the above options help, maybe check out anything recently installed into the GAC.
Solution 7:[7]
In my case restarting VS 2019 solved the issue.
Solution 8:[8]
In my case, changing Target version in UWP Project Settings, Application tab to the latest (Windows 11 in my case) fixed the problem.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Jim W says reinstate Monica |
| Solution 2 | Popa Andrei |
| Solution 3 | |
| Solution 4 | Andreas |
| Solution 5 | Muzzy |
| Solution 6 | PLN |
| Solution 7 | uceumern |
| Solution 8 | Mike Keskinov |
