子节点"2"过早退出

Dar*_*g8r 7 msbuild visual-studio-2015 windows-10-universal

我最近将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."
Run Code Online (Sandbox Code Playgroud)

这不是特别有用,所以我去%temp%寻找所说的故障日志,它不存在.我在寻找错误的"临时"目录吗?

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

Dar*_*g8r 5

所以,我手动解决了这个问题。我最终创建了一个新项目并逐个移动源文件。移动一些东西后,检查项目以确保它仍然构建。

事实证明,这条线存在于我的 App.xaml 中,它炸毁了它:

<ResourceDictionary Source="Assets/Resources/LayoutTemplates.xaml" p8:Name="LayoutTemplates" xmlns:p8="http://schemas.microsoft.com/winfx/2006/xaml" />
Run Code Online (Sandbox Code Playgroud)

删除命名空间和“名称”属性修复了问题。

好晦涩啊...

  • 就我而言,我只是将 MSBuild 平台从“Auto”更改为“X86”并运行。 (2认同)

Jim*_*ica 5

重新启动Windows为我解决了它。总是值得尝试这种奇怪的错误。