MSBuild could not create or connect to a task host with runtime "CLR2" and architecture "x86".

vs2010 and vs2012 are installed on target machine.

Build c# project using vs2010, following error occurred:

ERROR message :

error MSB4216: Could not run the "GenerateResource" task because MSBuild could not create or connect to a task host with runtime "CLR2" and architecture "x86".  Please ensure that (1) the requested runtime and/or architecture are available on the machine, and (2) that the required executable "C:\Program Files\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\MSBuildTaskHost.exe" exists and can be run.

Solution:

Set environment variables:

DisableOutOfProcTaskHost=true

____________________

Following solution is provided by  Forrest Guo

Following content is only used for knowledge sharing. ^^

This is a known issue which supposed to be fixed in later release. The MSBuildTaskHost.exe is introduced by Visual Studio 2012 but not the Windows SDK.  This is a new feature in VS 2012 build system, out of process build.

You can disable this feature if VS 2012 is not used in building. Setting environment variable: DISABLEOUTOFPROCTASKHOST=1

Reference: Build is unable to find MSBuildTaskHost.exe

上一篇:虚拟机中MySQL连接问题:Lost connection to MySQL server at 'reading initial communication packet, system error: 0 以及 host is not allowed to connect mysql


下一篇:Android自动测试之monkeyrunner工具