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

Use current runtime + architecture for GenerateResource on .NET Core #1293

Open
rainersigwald opened this issue Nov 1, 2016 · 2 comments
Open
Labels
bug help wanted Issues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim. .NET Core triaged
Milestone

Comments

@rainersigwald
Copy link
Member

See dotnet/sdk#346 (comment).

On .NET Core, MSBuild doesn't support task hosts of different architectures/runtime versions. But the CoreResGen target does some gymnastics to figure out the right architecture/runtime version to use for the GenerateResource task.

On .NET Core we should just use CurrentArchitecture/CurrentRuntime.

Or as @nguerrera suggested, maybe just add the DoesTaskHostExist check for Architecture as well as Runtime.

@rainersigwald
Copy link
Member Author

This is worked around for dev15. Pushing the better fix to later.

@rainersigwald rainersigwald modified the milestones: After 15, Visual Studio 15 RTW Jan 21, 2017
@dsplaisted
Copy link
Member

Another wrinkle to this is that TargetFrameworkAsMSBuildRuntime is based on the TargetFrameworkVersion, and doesn't check the TargetFrameworkIdentifier. This means that for projects targeting .NET Core 2.0 or .NET Standard 2.0, MSBuild will try to generate resources using .NET Framework 3.5. If it's not installed, then it will fail with:

The "Microsoft.Build.Tasks.GenerateResource" task could not be loaded from the assembly Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Could not load file or assembly 'Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted Issues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim. .NET Core triaged
Projects
None yet
Development

No branches or pull requests

3 participants