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

It isn't possible to customize the TargetDeviceFamily elements in the generated AppxManifest.xml file #9383

Open
MSLukeWest opened this issue Mar 2, 2024 · 2 comments
Labels
area-ProjectSystem bug Something isn't working team-Markup Issue for the Markup team

Comments

@MSLukeWest
Copy link

Describe the bug

I'm trying to generate an msix with a manifest that uses a unique set of values for the Windows.Desktop TargetDeviceFamily, something that looks like this:

<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.26031.0" MaxVersionTested="10.0.26031.0" />

Right now, the default values of a newly created project targeting 1.4 or 1.5 will be the following:

<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />

Here's how these values are determined:

  • The value for the MinVersion attribute can be customized by setting the "TargetPlatformMinVersion" property in my project file, though it can't be higher than MaxVersionTested.
  • The MaxVersionTested tested value comes from the "TargetPlatformVersion" property, which is determined in the .NET SDK by calling [MSBuild]::GetTargetPlatformVersion on the TargetFramework (see here). Note that if you try setting the "TargetPlatformVersion" property directly in the project file it will be overwritten.
  • The TargetFramework by default is set to something like "net6.0-windows10.0.19041.0", so that call evaluates to 10.0.19041.0. But it's not possible to put a custom value here, as it has to match one of the hard-coded "WindowsSdkSupportedTargetPlatformVersion" items from the .NET SDK, that correspond to the released versions of the Windows SDK (10.0.22621, 22000, 20348, 19041, etc.).

The result of all this is that there's no possible way for me to end up with a manifest that has a value higher than 10.0.22621 for the MaxVersionTested attribute of my TargetDeviceFamily.

Steps to reproduce the bug

Try to overwrite the MaxVersionTested value in the TargetDeviceFamily element of the generated AppxManifest.xml file.

Expected behavior

Value is set to something other than the version pulled from the TargetFramework value.

Screenshots

No response

NuGet package version

Windows App SDK 1.5.0: 1.5.240227000

Packaging type

Packaged (MSIX)

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022-preview

Additional context

No response

@evelynwu-msft evelynwu-msft transferred this issue from microsoft/WindowsAppSDK Mar 2, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Mar 2, 2024
@DarranRowe
Copy link

This seems to happen with the WinUI templates which come with the packaging as part of the project. The templates with the separate packaging project doesn't touch that setting.

@MSLukeWest
Copy link
Author

This seems to happen with the WinUI templates which come with the packaging as part of the project. The templates with the separate packaging project doesn't touch that setting.

@DarranRowe Thanks for mentioning that. If you're creating the package using a Windows Packaging project (.wapproj) then you can change these values by changing the TargetPlatformVersion and TargetPlatformMinVersion properties in the wapproj file. My repro steps are specifically for the scenario where you have just a single WinUI project that contains the AppxManifest.

@evelynwu-msft evelynwu-msft added area-ProjectSystem team-Markup Issue for the Markup team bug Something isn't working and removed needs-triage Issue needs to be triaged by the area owners labels Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-ProjectSystem bug Something isn't working team-Markup Issue for the Markup team
Projects
None yet
Development

No branches or pull requests

3 participants