windows 更新到 1909 后,在 VS Studio 2019 中构建我的解决方案时出现此错误

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

windows更新到 1909 后,在 VS Studio 2019 中构建我的解决方案时出现此错误

错误详情

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 Studio19\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

请让我知道之前遇到此问题的任何人,我们将不胜感激。

尝试在 xxx.csproj 文件中添加这些节点:

<PropertyGroup> 

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

关于此问题的更多步骤,您可以参考

更具体地说,将系统环境变量DisableOutOfProcTaskHost设置为true

DISABLEOUTOFPROCTASKHOST1.

正如我在

中所说

我有同样的错误(在版本 16.9.3 中)但是通过修复 Visual Studio 2019,更新最新版本 windows 10,关闭 VS,删除 .vs 隐藏文件夹(在解决方案文件夹下)、bin 和 obj 文件夹,然后重新启动您的 VS。还好我的问题解决了