JetBrains / teamcity-dotnet-plugin

TeamCity plugin for .NET projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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".

srikanthdasari opened this issue · comments

Hi,

Help please, i am getting this error, while i am trying to build dotnet core app in teacmcity.

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\2.0.2\MSBuild.exe" exists and can be run.

@srikanthdasari, could you please describe steps to reproduce it:

  • Plugin version
  • TeamCity version
  • .NET CLI installed on this build agent machine
  • part of build log where your build step is failing?

Do you have global.json file in your repository?

@dtretyakov thanks for responding...

Plugin version is
image

Teamcity Version - 2017.1.5 (build 47175)

Yes CLI installed in this build agent...and the agent is compatible..

image

C:\Program Files\dotnet\sdk\2.0.2\Microsoft.Common.CurrentVersion.targets(2925,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\2.0.2\MSBuild.exe" exists and can be run.

I dont have global.json

you can find that project in https://github.com/srikanthdasari/WpfSampleProj2.git

@srikanthdasari, thanks for repro. You have in this solution WPF project which is not supported by msbuild in .NET Core SDK. You could leave a comment in the mentioned issue to let MSFT know that you need it.

Publishing will work only with WpfSampleProj2.Lib and WpfSampleProj2.Services projects which is netstandard projects.

Also you could take a look at the possible workaround for WPF project: dotnet/sdk#346 (comment)

@dtretyakov thanks its working fine if i remove the WPF project...

but it would be great if i have option which could work with both core and non core projects..

@srikanthdasari, for solutions with mixed projects Microsoft recommends to use standalone MSBuild from Visual Studio or Build tools for Visual Studio.

For that you could leverage MSBuild step in your TeamCity build configuration.

I had the same Error.
but By Repairing Visual Studio 2019,
close VS, delete .vs hidden folder under solution folder and bin and obj folder then restart your VS to test again.
Fortunately My problem was solved.