You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 overridingIncludePackageReferencesDuringMarkupCompilation
to true.Actual behavior:
Build fails:
Expected behavior:
Successful build.
Minimal repro:
<Project Sdk="Microsoft.NET.Sdk;Microsoft.NET.Sdk.Web">
(I used Microsoft.NET.Sdk.Web as an exemple).Microsoft.NET.Sdk.Web
tries to importMicrosoft.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.
The text was updated successfully, but these errors were encountered: