Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions build/NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
<Import Project="$(MSBuildThisFileDirectory)Microsoft.WindowsAppSDK.AutoInitializerCommon.targets" />
<Import Project="$(MSBuildThisFileDirectory)Microsoft.WindowsAppSDK.AutoInitializer.CS.targets" Condition="'$(WindowsAppSdkAutoInitialize)' == 'true'"/>

<!-- Set TargetPlatformMinVersion from SupportedOSPlatformVersion if not already set -->
<Target Name="WindowsAppSDKSetTargetPlatformMinVersion" BeforeTargets="BeforeGenerateCurrentProjectAppxManifest">
<PropertyGroup>
<!-- If TargetPlatformMinVersion is not set but SupportedOSPlatformVersion is, use SupportedOSPlatformVersion -->
<TargetPlatformMinVersion Condition="'$(TargetPlatformMinVersion)' == '' AND '$(SupportedOSPlatformVersion)' != ''">$(SupportedOSPlatformVersion)</TargetPlatformMinVersion>
</PropertyGroup>
</Target>

<ItemGroup>
<Compile Condition="'$(WindowsAppSDKAggregatePackage)' == 'true' and '$(WindowsAppSdkIncludeVersionInfo)'=='true'" Include="$(MSBuildThisFileDirectory)..\include\WindowsAppSDK-VersionInfo.cs" />
</ItemGroup>
Expand Down
18 changes: 14 additions & 4 deletions build/NuSpecs/WindowsAppSDK-Nuget-Common.targets
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- Set TargetPlatformMinVersion from SupportedOSPlatformVersion if not already set -->
<Target Name="WindowsAppSDKSetTargetPlatformMinVersion" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<!-- If TargetPlatformMinVersion is not set but SupportedOSPlatformVersion is, use SupportedOSPlatformVersion -->
<TargetPlatformMinVersion Condition="'$(TargetPlatformMinVersion)' == '' AND '$(SupportedOSPlatformVersion)' != ''">$(SupportedOSPlatformVersion)</TargetPlatformMinVersion>
</PropertyGroup>
</Target>

<!-- Check TargetPlatformMinVersion during build to block unsupported configurations. -->
<Target Name="MicrosoftWindowsAppSDKCheckTargetPlatformVersion" BeforeTargets="PrepareForBuild"
<Target Name="MicrosoftWindowsAppSDKCheckTargetPlatformVersion" BeforeTargets="PrepareForBuild"
AfterTargets="WindowsAppSDKSetTargetPlatformMinVersion"
Condition="'$(TargetPlatformVersion)' != '' and '$(TargetPlatformMinVersion)' != '' and '$(SkipMicrosoftWindowsAppSDKCheckTargetPlatformVersion)'==''">
<PropertyGroup>
<MicrosoftWindowsAppSDKTargetPlatformMinCheckValue>$([System.Version]::Parse('$(TargetPlatformMinVersion)').Build)</MicrosoftWindowsAppSDKTargetPlatformMinCheckValue>
</PropertyGroup>
<Error
Text="Microsoft.WindowsAppSDK nuget package requires TargetPlatformMinVersion &gt;= 10.0.17763.0 (current project is $(MicrosoftWindowsAppSDKTargetPlatformMinCheckValue))"
Text="Microsoft.WindowsAppSDK nuget package requires TargetPlatformMinVersion >= 10.0.17763.0 (current project is $(MicrosoftWindowsAppSDKTargetPlatformMinCheckValue))"
Condition="$(MicrosoftWindowsAppSDKTargetPlatformMinCheckValue) &lt; 17763" />
<PropertyGroup>
<MicrosoftWindowsAppSDKTargetPlatformCheckValue>$([System.Version]::Parse('$(TargetPlatformVersion)').Build)</MicrosoftWindowsAppSDKTargetPlatformCheckValue>
</PropertyGroup>
<Error
Text="Microsoft.WindowsAppSDK nuget package requires TargetPlatformVersion &gt;= 10.0.18362.0 (current project is $(MicrosoftWindowsAppSDKTargetPlatformCheckValue))"
Text="Microsoft.WindowsAppSDK nuget package requires TargetPlatformVersion >= 10.0.18362.0 (current project is $(MicrosoftWindowsAppSDKTargetPlatformCheckValue))"
Condition="$(MicrosoftWindowsAppSDKTargetPlatformCheckValue) &lt; 18362" />
</Target>
</Project>
8 changes: 8 additions & 0 deletions build/NuSpecs/WindowsAppSDK-Nuget-Native.targets
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,12 @@
<Import Project="$(MSBuildThisFileDirectory)..\Microsoft.WindowsAppSDK.AutoInitializerCommon.targets" />
<Import Project="$(MSBuildThisFileDirectory)WindowsAppSDK-Nuget-Native.AutoInitializer.targets" Condition="'$(WindowsAppSdkAutoInitialize)' == 'true'"/>

<!-- Set TargetPlatformMinVersion from SupportedOSPlatformVersion if not already set -->
<Target Name="WindowsAppSDKSetTargetPlatformMinVersion" BeforeTargets="BeforeGenerateCurrentProjectAppxManifest">
<PropertyGroup>
<!-- If TargetPlatformMinVersion is not set but SupportedOSPlatformVersion is, use SupportedOSPlatformVersion -->
<TargetPlatformMinVersion Condition="'$(TargetPlatformMinVersion)' == '' AND '$(SupportedOSPlatformVersion)' != ''">$(SupportedOSPlatformVersion)</TargetPlatformMinVersion>
</PropertyGroup>
</Target>

</Project>
4 changes: 4 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ In-box components will be supported forever in the usual way. We have no plans t
(remove their usability) at this time. We will likely slow down or pause investment in
the in-box components while we focus on making the Windows App SDK surface complete.

## How does Windows App SDK handle SupportedOSPlatformVersion and TargetPlatformMinVersion?

When using Windows App SDK with .NET projects that set both `TargetFramework` (like net8.0-windows10.0.22621.0) and `SupportedOSPlatformVersion` (like 10.0.19041.0), Windows App SDK will ensure that `TargetPlatformMinVersion` is set to match `SupportedOSPlatformVersion` if `TargetPlatformMinVersion` is not explicitly defined. This ensures that your app can be installed on all operating system versions that you've indicated support for via `SupportedOSPlatformVersion`, rather than just the OS version specified in `TargetFramework`.

## I don't see my question here!

[Create an issue to ask a question or start a discussion](https://github.com/microsoft/WindowsAppSDK/issues/new/choose).
Expand Down