Skip to content

Support CsWinRT 3.0 multi-targeting and WindowsSdkPackageMinimumRevision #50264

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

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

dsplaisted
Copy link
Member

This is a continuation of #49721

This PR allows multi-targeting CsWinRT 3.0, by leveraging the build number of the target Windows SDK.
That is, e.g.:

  • net10.0-windows10.0.22621.0 ---> CsWinRT 2.x
  • net10.0-windows10.0.22621.1 ---> CsWinRT 3.0

In the implementation, rather than using separate ref packs for CSWinRT 2 and 3, which the previous PR did, this PR uses profiles of the Microsoft.Windows.SDK.NET.Ref framework reference to differentiate between the versions of CSWinRT.

This also adds support for a WindowsSdkPackageMinimumRevision property.

Comment on lines +1320 to +1333
<!--
Supported Windows versions using CsWinRT 3.0 (.NET 10 is the baseline). This leverages the revision of
the Windows SDK version to allow multi-targeting, which is required to allow customers to gradually migrate.
Both CsWinRT 3.0 and 2.x will be supported for a period of time, and packages can target both of them.
-->
<WindowsSdkSupportedTargetPlatformVersion Include="10.0.26100.1" WindowsSdkPackageVersion="$(MicrosoftWindowsSDKNETRef10_0_26100PackageVersion)" MinimumNETVersion="10.0" />
<WindowsSdkSupportedTargetPlatformVersion Include="10.0.22621.1" WindowsSdkPackageVersion="$(MicrosoftWindowsSDKNETRef10_0_22621PackageVersion)" MinimumNETVersion="10.0" />
<WindowsSdkSupportedTargetPlatformVersion Include="10.0.22000.1" WindowsSdkPackageVersion="$(MicrosoftWindowsSDKNETRef10_0_22000PackageVersion)" MinimumNETVersion="10.0" />
<WindowsSdkSupportedTargetPlatformVersion Include="10.0.20348.1" WindowsSdkPackageVersion="$(MicrosoftWindowsSDKNETRef10_0_20348PackageVersion)" MinimumNETVersion="10.0" />
<WindowsSdkSupportedTargetPlatformVersion Include="10.0.19041.1" WindowsSdkPackageVersion="$(MicrosoftWindowsSDKNETRef10_0_19041PackageVersion)" MinimumNETVersion="10.0" />
<WindowsSdkSupportedTargetPlatformVersion Include="10.0.18362.1" WindowsSdkPackageVersion="$(MicrosoftWindowsSDKNETRef10_0_18362PackageVersion)" MinimumNETVersion="10.0" />
<WindowsSdkSupportedTargetPlatformVersion Include="10.0.17763.1" WindowsSdkPackageVersion="$(MicrosoftWindowsSDKNETRef10_0_17763PackageVersion)" MinimumNETVersion="10.0" />

<!-- Supported Windows versions using CsWinRT 2.x -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably need to undo this too, if we're going to use the same package for .NET 9 and 10?

Comment on lines +1320 to +1333
<!--
Supported Windows versions using CsWinRT 3.0 (.NET 10 is the baseline). This leverages the revision of
the Windows SDK version to allow multi-targeting, which is required to allow customers to gradually migrate.
Both CsWinRT 3.0 and 2.x will be supported for a period of time, and packages can target both of them.
-->
<WindowsSdkSupportedTargetPlatformVersion Include="10.0.26100.1" WindowsSdkPackageVersion="$(MicrosoftWindowsSDKNETRef10_0_26100PackageVersion)" MinimumNETVersion="10.0" />
<WindowsSdkSupportedTargetPlatformVersion Include="10.0.22621.1" WindowsSdkPackageVersion="$(MicrosoftWindowsSDKNETRef10_0_22621PackageVersion)" MinimumNETVersion="10.0" />
<WindowsSdkSupportedTargetPlatformVersion Include="10.0.22000.1" WindowsSdkPackageVersion="$(MicrosoftWindowsSDKNETRef10_0_22000PackageVersion)" MinimumNETVersion="10.0" />
<WindowsSdkSupportedTargetPlatformVersion Include="10.0.20348.1" WindowsSdkPackageVersion="$(MicrosoftWindowsSDKNETRef10_0_20348PackageVersion)" MinimumNETVersion="10.0" />
<WindowsSdkSupportedTargetPlatformVersion Include="10.0.19041.1" WindowsSdkPackageVersion="$(MicrosoftWindowsSDKNETRef10_0_19041PackageVersion)" MinimumNETVersion="10.0" />
<WindowsSdkSupportedTargetPlatformVersion Include="10.0.18362.1" WindowsSdkPackageVersion="$(MicrosoftWindowsSDKNETRef10_0_18362PackageVersion)" MinimumNETVersion="10.0" />
<WindowsSdkSupportedTargetPlatformVersion Include="10.0.17763.1" WindowsSdkPackageVersion="$(MicrosoftWindowsSDKNETRef10_0_17763PackageVersion)" MinimumNETVersion="10.0" />

<!-- Supported Windows versions using CsWinRT 2.x -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also delete the old items for .NET 5 and 6 below? Since they're out of support now?

.Should()
.Pass()
.And
.NotHaveStdOutContaining("NETSDK1229");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmh isn't this wrong? This test should emit the warning, right? 🤔

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

Successfully merging this pull request may close these issues.

3 participants