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

Build fails when using multiple SDK #5921

Closed
ThomasGoulet73 opened this issue Jan 8, 2022 · 0 comments · Fixed by #5922
Closed

Build fails when using multiple SDK #5921

ThomasGoulet73 opened this issue Jan 8, 2022 · 0 comments · Fixed by #5922
Assignees
Labels
Bug Product bug (most likely) regression status: This issue is a regression from a previous build or release

Comments

@ThomasGoulet73
Copy link
Contributor

Problem description:
Build error when using multiple SDKs in the SDK attribute when IncludePackageReferencesDuringMarkupCompilation is set to true.

This is an accidental regression introduced in the .Net 6 SDK when IncludePackageReferencesDuringMarkupCompilation was changed to true by default. The same bug is happening in the .Net 5 SDK when overriding IncludePackageReferencesDuringMarkupCompilation to true.

Actual behavior:
Build fails:

MSB4236	The SDK 'Microsoft.NET.Sdk;Microsoft.NET.Sdk.Web' specified could not be found.

Expected behavior:
Successful build.

Minimal repro:

  • Create a new WPF project.
  • Add a new SDK at the end of the current SDK in the project so the first line of the file looks like this: <Project Sdk="Microsoft.NET.Sdk;Microsoft.NET.Sdk.Web"> (I used Microsoft.NET.Sdk.Web as an exemple).
  • Build the project and look for the error in the build output. (It also gives warnings which is just because Microsoft.NET.Sdk.Web tries to import Microsoft.NET.Sdk which is already imported).

Doing the same thing but using a Console project in the first step does not produce an error.

This issue does not really affect me since I don't use mulitple SDKs but I came accross this eror when looking at the code while investigating #5711.
I already have a fix and I'm going to send a PR shortly, I am opening this issue for tracking.

ThomasGoulet73 added a commit to ThomasGoulet73/wpf that referenced this issue Jan 8, 2022
@gurpreet-wpf gurpreet-wpf added Bug Product bug (most likely) regression status: This issue is a regression from a previous build or release and removed Untriaged Requires WPF team triage labels Jan 10, 2022
singhashish-wpf pushed a commit that referenced this issue Mar 30, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Apr 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Product bug (most likely) regression status: This issue is a regression from a previous build or release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants