子节点“2”提前退出

问题描述 投票:0回答:11

我最近将我的 Windows 8.1 应用程序重新定位到 Windows 10。我在构建 UI 项目时遇到此错误,

"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."

这不是特别有用,所以我去%temp%寻找所说的失败日志,但它不存在。我是否在错误的“temp”目录中查找?

导致此错误的原因是什么?我可以构建我的支持库项目而不会出现此错误。

msbuild visual-studio-2015 windows-10-universal
11个回答
6
投票

重新启动 Windows 为我解决了这个问题。像这样的奇怪错误总是值得一试。


5
投票

所以,我手动完成了这个工作。我最终创建了一个新项目并逐个移动源文件。移动某些内容后,检查项目以确保它仍然可以构建。

事实证明,我的 App.xaml 中存在这一行,导致它崩溃:

<ResourceDictionary Source="Assets/Resources/LayoutTemplates.xaml" p8:Name="LayoutTemplates" xmlns:p8="http://schemas.microsoft.com/winfx/2006/xaml" />

删除命名空间和“Name”属性解决了问题。

相当晦涩啊...


2
投票

我修复了 .net 框架(控制面板 -> 程序和功能.. -> 修复),因为我的假设是 MSBuild 所需的 dll 已损坏。它现在可以工作,但我不知道这是随机发生的还是一切都很好。


1
投票

就我而言,将 UWP 项目设置、应用程序选项卡中的

Target version
更改为最新版本(在我的情况下为
Windows 11
)解决了问题。


0
投票

从 2016 年 11 月 11 日起,我就开始在我们的 C++ 项目中遇到这些错误。检查 Windows 更新,它在早上安装了以下针对 Windows 10 的 Microsoft 更新:

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

禁用多处理器编译 /MP(在项目设置中,C/C++ 下的常规)似乎可以避免该问题。

郑重声明:使用 incredibuild 7.22 时发生。没有测试它是否也会在没有 incredibuild 的情况下发生。


0
投票

对我来说,在 Windows Server 2012 R2 上设置构建环境后出现错误。

我在同一工作区中并行运行多个 MSBuild 实例。按顺序运行 MSBuild 实例或在不同的工作区中运行可以使问题消失。

鉴于其他答案,我的看法是错误消息是“出现了严重错误并剧烈崩溃”。如果你问我的话,MSBuild 的鲁棒性错误。


0
投票

就我而言,它是 SlowCheetah,我为所有“内容”项目设置了默认转换:

<Content>
  <TransformOnBuild>true</TransformOnBuild>
  <Link></Link>
  <CopyToOutputDirectory></CopyToOutputDirectory>
</Content>

这导致构建占用越来越多的内存(如 1.7GB)并最终抛出“子节点”消息。 重新启动 Windows 后,我的 VS 2019 只是关闭,而不是在每次构建时都出现错误。将内容转换设置为 false 解决了问题。


0
投票

我遇到了同样的错误。就我而言,存在 MSBuild failure.txt 文件,并列出了此错误:

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)

在尝试了上述一些选项之后,我偶然发现 Npgsql 程序集在 GAC 中的安装错误。卸载 Npgsql 似乎已经解决了该问题。因此,如果上述选项都没有帮助,也许可以检查一下最近安装到 GAC 中的任何内容。


0
投票

就我而言,重新启动 VS 2019 解决了该问题。


0
投票

对我来说,问题是我添加了对 .NET Framework 库的引用。我没有在它列出的日志文件中获得任何诊断信息,VS 将在构建时崩溃。删除该引用使一切再次正常工作。


0
投票

清除临时 asp .net 文件可以解决此问题: 路径:C:\Windows\Microsoft.NET\Framework64 4.0.30319\Temporary ASP.NET Files

© www.soinside.com 2019 - 2024. All rights reserved.