Skip to content

Microsoft.Windows.SDK.BuildTools.MSIX does not support AppxOSMinVersionReplaceManifestVersion, AppxOSMaxVersionTestedReplaceManifestVersion #5598

@Scottj1s

Description

@Scottj1s

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

  1. Create a WinUI3 project from the single-project (non-wapproj) template
  2. Set the MinVersion and MaxVersionTested fields in the appxmanifest.xml to values distinct from the project's TargetPlatformMinVersion and TargetPlatformVersion, respectively.
  3. Add the project properties AppxOSMinVersionReplaceManifestVersion and AppxOSMaxVersionTestedReplaceManifestVersion, setting both to false.
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-DeploymentIssues related to packaging, installation, runtime (e.g., SelfContained, Unpackaged)needs-triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions