-
Notifications
You must be signed in to change notification settings - Fork 0
Automatically set default WindowsSdkPackageVersion for Windows App SDK projects #6
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: LegendaryBlair <[email protected]>
Co-authored-by: LegendaryBlair <[email protected]>
| --> | ||
| <PropertyGroup Condition="'$(WindowsSdkPackageVersion)' == '' And '$(MSBuildProjectExtension)' == '.csproj'"> | ||
| <!-- Default to the Windows SDK version that is compatible with the current Windows App SDK --> | ||
| <WindowsSdkPackageVersion>10.0.17763.38</WindowsSdkPackageVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not make sense to set default WindowsSdkPackageVersion to be 10.0.17763.38.
First, the target OS version is not necessarily to be 10.0.17763.0.
Secondly, the Cs/WinRT projection version 38 is a special case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot please work on the above comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the code to address this issue in commit 3dab581. Instead of hardcoding 10.0.17763.38, I've implemented a more flexible solution that:
-
Introduces two new configurable properties:
WindowsAppSDKDefaultSdkVersion(defaults to10.0.17763)WindowsAppSDKCsWinRTProjectionVersion(dynamically usesCsWinRTDependencyWindowsSdkVersionSuffixPackageVersionwith fallback to38)
-
Constructs
WindowsSdkPackageVersiondynamically from these properties
This approach avoids hardcoding specific versions while still providing the necessary compatibility defaults. Projects can override either part of the version independently if needed.
…ersion Co-authored-by: LegendaryBlair <[email protected]>
Summary
This PR fixes an issue where Windows App SDK projects require manual configuration of the
WindowsSdkPackageVersionproperty to ensure compatibility between Windows App SDK and Windows SDK projections, particularly for AOT support in Windows App SDK 1.6+.Implementation
Created a new
Microsoft.WindowsAppSDK.CsWinRTCompatibility.targetsfile that:WindowsSdkPackageVersionto10.0.17763.38for C# projects when not specifiedUpdated
Microsoft.WindowsAppSDK.Foundation.targetsto import the new compatibility targets fileBenefits
WindowsSdkPackageVersionBefore this change, users would encounter an error message instructing them to add the
WindowsSdkPackageVersionproperty to their project file. Now, this property is set automatically to the correct value, ensuring compatibility between Windows App SDK 1.6+ and the Windows SDK projections.Fixes #5.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.