Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
srikanthdasari opened this issue Nov 4, 2017 · 6 comments
Labels

Comments

@srikanthdasari
Copy link

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.

@dtretyakov
Copy link
Contributor

@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?

@srikanthdasari
Copy link
Author

@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

@dtretyakov
Copy link
Contributor

@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)

@srikanthdasari
Copy link
Author

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

@dtretyakov
Copy link
Contributor

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

@arabsorkhi
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants