In case you are facing the following error MSB4017: Could not run the "GenerateResource" task because MSBuild could not create or connect, while building your project/solution in Visual Studio, this could be because the build system is running out of the build process.
To resolve this error, there could be two different approaches. In this quick note, sharing both the solutions for your easy reference.
While building projects/solutions in Visual Studio, the build may break with the following error log:
MSB4017: 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 (x86)\MSBuild\14.0\bin\MSBuildTaskHost.exe" exists and can be run.
This may happen when the build system is running out of the build process. This is a feature introduced in Visual Studio 2012 and the error can happen in older versions too. To resolve this error, you need to disable the out of process task host.
How to resolve the issue?
To resolve it, go to all your
.csproj file where the error is occuring and add the following line under the default property group:
<PropertyGroup> .... .... <DisableOutOfProcTaskHost>true</DisableOutOfProcTaskHost> </PropertyGroup>
Alternative approach to resolve the issue
Alternatively, you can perform the following steps to disable the out of process task host for all users in that system:
- Click on the
- Right-click on
and then navigate to
Advanced system settings
button to open the dialog.
- Now, under the
- Enter the
DISABLEOUTOFPROCTASKHOST, and enter the
to save the configurational details.
- You may have to restart the system in order to apply the configurational changes.
If you have come this far, it means that you liked what you are reading. Why not reach little more and connect with me directly on
. I would love to hear your thoughts and opinions on my articles directly.
Also, don’t forget to share your views and/or feedback in the comment section below.