Archive | Windows 10 RSS feed for this section

Child node exited prematurely. Shutting down.

13 Jan

As written yesterday I have spend the weekend working on a Windows 8.1 solution for a customer. For several good reasons (mostly fun) I tested the solution on my Windows 10 Preview machine running Visual Studio 2015 Preview.

When I compiled I got the following error:

Child node “2” exited prematurely. Shutting down. Diagnostic information may be found in files in the temporary files directory named MSBuild_*.failure.txt.

The error itself didn’t reveal much about the error but of course everything pointed at either Windows 10 Preview or Visual Studio 2013 Preview.

A quick search showed surprising few results. I found two leads that I tried to follow.

First lead was this one Problems with Parallel build using MSBuild at StackOverflow. It lead me into modifying the MSBuild process to run without parallel. I tested in a command prompt with the following command.

“C:\Source\[Customer]\[Project]\[Solution].sln” /t:Build /m
/v:q /p:Optimize=”True”;DebugSymbols=”True”;Configuration=”Release”

The issue remained and I had to follow my next lead HeatDirectory failure on TFS with MSBUILD error MSB4166: Child node “3” exited prematurely also from StackOverflow. It lead me into modifying the solution and projects to x86 instead of x64 as well as changing the MSBuild process to build on an x86 platform. The issue remained.

To be honest at this point everything seamed like a bug in Visual Studio 2015 Preview and I actually considered giving up and accepting the bug (hahaha I wouldn’t give up in a million years!). A little bit desperate I installed Visual Studio 2013 on my Windows 10 Preview machine. To my frustration the issue remained in Visual Studio 2013.

For fun I tried to begin to exclude projects and files in the solution. First the test projects (of course!), then the portable class libraries and then the nuget packages. The issue remained. Finally I began removing features and styles and suddently I could build and 5 minutes later I had identified the bug.

As part of our refactoring between the Windows Phone 8.1 project and Windows 8.1 project we had by mistake added a DataTemplate to a ResourceDictionary. Well it is actually ok but the issues was that a Button in the DataTemplate called the Tapped eventhandler (and that is definitely no-go!).

To reproduce the error all you need to do is add a ResourceDictionary to your solution (you don’t need to make a reference to it from the App.xaml file). Add the following DataTemplate to the ResourceDictionary:

<DataTemplate x:Key=”template1″>
<Button Content=”Hello World”
Tapped=”button_Tapped” />

With the eventhandler removed the solution compiled in both Visual Studio 2013 and Visual Studio 2015 Preview on my Windows 10 Preview machine. Finally! :D

Obviously something is changed between Windows 8.1 and Windows 10 in the way solutions are compiled or at least at what causes a compile error (looking into that now). And I guess a few improvements could be in place regarding the error message :)

// thomas