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

Enable Windows.UI.Xaml profile for Windows SDK projections #41936

Conversation

Sergio0694
Copy link
Contributor

This PR adds support for two new profiles for the Windows SDK projections (aka "Microsoft.Windows.SDK.NET.Ref"):

  • "Windows": just the Windows SDK, without anything in Windows.UI.Xaml.*
  • "Full": with the entire Windows SDK (including Windows.UI.Xaml.* types)

Additionally, it includes the following changes:

  • Automatically select the "Full" profile when the "UseUwp" property is set
  • Error (NETSDK1216) when "UseUwp" is not set but the "Full" package is transitively referenced
  • Set CsWinRT feature switch for WUX projections automatically when "UseUwp" is set

Note

Need to add tests, and we still need to publish the updated Windows SDK projections, but reviews welcome.

Copy link
Member

@dsplaisted dsplaisted left a comment

Choose a reason for hiding this comment

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

This generally looks good.

It does differ from how we normally handle profiles. Normally profiles are always a subset of the full set of references for a shared framework, and a reference without a profile would be used to reference all of the references. In that model, instead of Microsoft.Windows.SDK.NET.Ref.Full, you'd just have Microsoft.Windows.SDK.NET.Ref (the same as you have today). Then you'd add Microsoft.Windows.SDK.NET.Ref.Windows for the subset without Windows.UI.Xaml.

I'm not sure if there's going to be anything wrong with the way this PR currently implements things, but if there's no specific reason to use two separate profiles, it's probably safer to keep to the existing model.

I don't remember how exactly PrivateAssets="all" behaves for FrameworkReferences. If it stops the framework reference from flowing across project references, then I think the transitive error check would never trigger. If it doesn't stop the FrameworkReference from flowing through NuGet packages, then in the current version of this PR you could have errors referencing NuGet packages which depend on the Microsoft.Windows.SDK.NET.Ref framework, which doesn't exist anymore.

@Sergio0694 Sergio0694 marked this pull request as ready for review August 8, 2024 23:23
@Sergio0694 Sergio0694 force-pushed the user/sergiopedri/windows-full-profiles branch 2 times, most recently from 939027c to b81b8b6 Compare August 12, 2024 02:34
Copy link
Member

@dsplaisted dsplaisted left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@Sergio0694 Sergio0694 changed the base branch from main to release/9.0.1xx August 22, 2024 21:18
@Sergio0694 Sergio0694 requested review from a team as code owners August 22, 2024 21:18
@MartinZikmund
Copy link

MartinZikmund commented Oct 15, 2024

@Sergio0694 after updating a blank WinUI 3 .NET 8 app to WindowsSdkPackageVersion xyz.48:

<WindowsSdkPackageVersion>10.0.19041.48</WindowsSdkPackageVersion>

I am now seeing both of these are now valid:

var red = Microsoft.UI.Colors.Red;
var red2 = Windows.UI.Colors.Red;

Is that change intentional 🤔 ? Same goes for Microsoft.UI.Text.FontWeights

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure Partner request requests from partners untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants