Today, preparing a Windows Embedded Compact 2013 image for an eBox 3310A and for the demo at Microsoft Embedded Conference in February 2014, the Windows 7 operating system (a virtual machine) decides to upgrade the version of .Net Framework from 4.5 to 4.5.1.
Reboot the system and resume the job ... but the build system for Visual Studio 2012 has gone mad and the next attempt to build fails!

fatalerror

A warning indicates that the .Net Framework 4.5 is not installed on the system and an obvious fatal error indicates that the compilation can not be done!

I have found no official news from Microsoft to fix this problem but I have circumvented the problem in the following way ....

First I open the file indicated by the fatal error, ie sources.ce in the path C: \ WINCE800 \ public \ common \ oak \ misc, which reports the error in case the environment variable _DOTNET40ROOT  is empty.

!IF "$(_DOTNET40ROOT)" == ""
!   ERROR Error: Microsoft.NET Framework v4.x must be installed on your machine.
!ENDIF

At the top of the file, I set the environment variable at the installation path of .Net Framework, C:\Windows\Microsoft.NET\Framework\v4.0.30319.

_DOTNET40ROOT=C:\Windows\Microsoft.NET\Framework\v4.0.30319

This first step allows me to overcome the block in the first SYSGEN phase but the build still fails, because MSBuild still does not "see" the. Net Framework. The simplest solution is to set the path of .Net Framework also in the PATH variable (using the control panel).

cp

After this step, the system returns to build and starts to work properly !

While waiting for official action from Microsoft, I hope this workaround can be helpful to those like me who have found themselves in front of this issue.