How to fix: Could not run the “GenerateResource” task because MSBuild could not create or connect to a task host with runtime “CLR4” and architecture “x86”

 

C:\Program Files\dotnet\sdk\3.1.301\Microsoft.Common.CurrentVersion.targets(3032,5):

error MSB4216: Could not run the “GenerateResource” task because MSBuild could not create or connect to a task host with runtime “CLR4” 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\dotnet\sdk\3.1.301\MSBuild.exe” exists and can be run. [C:\…….csproj]

C:\Program Files\dotnet\sdk\3.1.301\Microsoft.Common.CurrentVersion.targets(3054,7): error MSB4028: The “GenerateResource” task’s outputs could not be retrieved from the “FilesWritten” parameter. Object does not match target type. [C:\……csproj]

……. -> C:.…..dll

 

I was using dotnet build, to build a solution that contained not only .NET Core applications.

To fix the problem I added the specific project I wanted to build to the dotnet build command: dotnet build “path to the csproj file”.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.