Skip to content

Conversation

Copy link

Copilot AI commented May 22, 2025

Issue

When a .NET project sets both TargetFramework (e.g., net8.0-windows10.0.22621.0) and SupportedOSPlatformVersion (e.g., 10.0.19041.0), the installer wouldn't allow installation on Windows versions older than the version specified in TargetFramework, ignoring the SupportedOSPlatformVersion setting.

This happens because:

  1. The TargetPlatformMinVersion property is used to determine the minimum OS version in the AppxManifest.xml
  2. For .NET projects (especially WinUI apps), TargetPlatformMinVersion is often not set explicitly
  3. When TargetPlatformMinVersion is not set, the build system doesn't automatically use SupportedOSPlatformVersion as a fallback

Solution

This PR updates the MSBuild targets to set TargetPlatformMinVersion based on SupportedOSPlatformVersion when TargetPlatformMinVersion is not explicitly defined. This ensures the correct minimum OS version is written to the AppxManifest.xml file.

Changes:

  • Added an MSBuild target to both .NET and C++ project targets files that sets TargetPlatformMinVersion from SupportedOSPlatformVersion when appropriate
  • Updated common targets to ensure this behavior is consistent
  • Added documentation in the FAQ explaining this behavior

With these changes, developers can correctly specify their minimum supported OS version through SupportedOSPlatformVersion and have it respected by the installer, while still targeting newer OS features through TargetFramework.

Example project configuration that will now work correctly:

<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>

Fixes #7.


💡 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.

Copilot AI and others added 2 commits May 22, 2025 09:21
Co-authored-by: LegendaryBlair <122517415+LegendaryBlair@users.noreply.github.com>
Co-authored-by: LegendaryBlair <122517415+LegendaryBlair@users.noreply.github.com>
Copilot AI changed the title [WIP] SupportedOSPlatform is ignored by the installer (4661) Fix: Ensure SupportedOSPlatformVersion is respected by installer when TargetPlatformMinVersion is not set May 22, 2025
Copilot AI requested a review from LegendaryBlair May 22, 2025 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SupportedOSPlatform is ignored by the installer (4661)

2 participants