After windows update to 1909, getting this error while building my solution in VS Studio 2019

222 Views Asked by At

After windows update to 1909, getting this error while building my solution in VS Studio 2019

Error Details

Could not run the "GenerateResource" task because MSBuild could not create or connect to a task host with runtime "CLR4" and architecture "x64". 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)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\amd64\MSBuild.exe" exists and can be run.

Windows version: 1909
Upgraded from 1803

Visual Studio version: Visual Studio Professional 2019 version 16.7.5

Please let me know anyone encountered this issue earlier, any help will be appreciated.

2

There are 2 best solutions below

3
On BEST ANSWER

Try to add these node in xxx.csproj file:

<PropertyGroup> 

<GenerateResourceMSBuildArchitecture>CurrentArchitecture</GenerateResourceMSBuildArchitecture>
<GenerateResourceMSBuildRuntime>CurrentRuntime</GenerateResourceMSBuildRuntime>
    
</PropertyGroup>

More steps about this issue, you can refer to this similar issue.

To be more specific, set an system environment variable DisableOutOfProcTaskHost to true.

Or DISABLEOUTOFPROCTASKHOST to 1.

0
On

as I said in here

I had the same Error (in version 16.9.3) but By Repairing Visual Studio 2019, Updating last version of windows 10, close VS, delete .vs hidden folder (under solution folder) ,bin and obj folder then restart your VS . Fortunately My problem was solved.