-
Notifications
You must be signed in to change notification settings - Fork 377
Description
Describe the bug
For UWP and wapproj-based solutions, the default build behavior is to set the MinVersion and MaxVersionTested values in the project's package.appxmanifest with the project's values for TargetPlatformMinVersion and TargetPlatformVersion, respectively. This behavior isn't always desirable, and can be overridden by setting the project properties AppxOSMinVersionReplaceManifestVersion and/or AppxOSMaxVersionTestedReplaceManifestVersion to false.
However, the WinAppSDK single-project support provided by the Microsoft.Windows.SDK.BuildTools.MSIX does not support these override properties, but always replaces MinVersion and MaxVersionTested.
The UpdateTargetDeviceFamily task in WinAppSdkGenerateAppxManifest.cs should be updated to support the override (opt-out) properties to preserve the existing MinVersion and MaxVersionTested values from the project's appxmanifest.xml when generating the project's package.appxmanifest.
Steps to reproduce the bug
- Create a WinUI3 project from the single-project (non-wapproj) template
- Set the MinVersion and MaxVersionTested fields in the appxmanifest.xml to values distinct from the project's TargetPlatformMinVersion and TargetPlatformVersion, respectively.
- Add the project properties AppxOSMinVersionReplaceManifestVersion and AppxOSMaxVersionTestedReplaceManifestVersion, setting both to false.
- Build the project and package the output. The resulting package.appxmanifest will contain replace values of MinVersion and MaxVersionTested, rather than preserving their values.
Expected behavior
The package.appxmanifest should preserve the values of MinVersion and MaxVersionTested from the appxmanifest.xml.
NOTE: the docs here suggest using the override properties, but also suggest setting TargetDeviceFamily, which is effectively providing a workaround.
Screenshots
No response
NuGet package version
None
Packaging type
No response
Windows version
No response
IDE
No response
Additional context
No response