Search code examples
c#windowsinstallationversionmsix

The package requires OS version 10.0.22621.0


We have a C# App for windows using Win UI3 and the Windows CommunityToolkit. This has always been working against OS version 19041. If I set the TargetFramework to 22621 and the SupportedOSPlatformVersion to 19041 however, the installer refuses to install on Windows 19041, even though it is techinally supported.

enter image description here

I get the following installer error: App installation failed with error message: Windows cannot install package because this package is not compatible with the device. The package requires OS version 10.0.22621.0 or higher on the Windows.Desktop device family. The device is currently running OS version 10.0.19041.208. (0x80073cfd)

Does anyone have an idea how to work around this? How can we tell the installer is should run on Windows version 19041? If that is not possible, what is the point of the SupportedOSVersion?

Notes:

  • We are creating and MSIXBundle to install the App with. This is of course signed with a valid certificate. This MSIBundle installer is what is throwing the error.
  • We are using the CommunityToolkit which requires this upgrade in the upcoming version.

Edit: We are creating the installer as follows in Azure Devops Pipelines:

  • task: CmdLine@2 displayName: Bundle msix files to msixbundle continueOnError: true inputs: script: | "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\makeappx.exe" bundle /d $(Build.ArtifactStagingDirectory)\ /p "$(Build.ArtifactStagingDirectory)$(applicationName).msixbundle"

Solution

  • I have found the solution. The Windows Project files requires <TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>

    The AppXManifest.xml file gets the MinVersion from this property. But with a WinUI app this property is not usually present in the .csproj file. Instead, it has the SupportedOSPlatformVersion property, however, this is not used for the AppXManifest.xml file and thus not used for the manifest of the Bundle.