From 9a286c386b48214dfae0e9f6b040d0d3795fcb3d Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 10 Sep 2024 17:03:40 +0200 Subject: [PATCH] Suggest package versions based on configuration --- .../CommunityToolkit.Mvvm.WindowsSdk.targets | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.WindowsSdk.targets b/src/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.WindowsSdk.targets index 5b7389ec..c272142d 100644 --- a/src/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.WindowsSdk.targets +++ b/src/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.WindowsSdk.targets @@ -21,8 +21,20 @@ - - <_MvvmToolkitWindowsSdkPackageMinBuild>41 + + <_MvvmToolkitWindowsSdkPackageMinBuild>38 + <_MvvmToolkitWindowsSdkPackageRecommendedUwpBuild>39 + <_MvvmToolkitWindowsSdkPackageRecommendedWindowsAppSDKBuild>41 + + + <_MvvmToolkitWindowsSdkPackageRecommendedBuild>$(_MvvmToolkitWindowsSdkPackageMinBuild) + <_MvvmToolkitWindowsSdkPackageRecommendedBuild Condition="'$(UseUwp)' == 'true'">$(_MvvmToolkitWindowsSdkPackageRecommendedUwpBuild) + <_MvvmToolkitWindowsSdkPackageRecommendedBuild Condition="'$(UseUwp)' == 'false'">$(_MvvmToolkitWindowsSdkPackageRecommendedUwpBuild) @@ -30,6 +42,7 @@ <_MvvmToolkitWindowsSdkPackage Include="$(WindowsSdkPackageVersion)" Condition="'$(WindowsSdkPackageVersion)' != ''"> $(WindowsSdkPackageVersion) 10.0.$([System.Version]::Parse("$(WindowsSdkPackageVersion.Split('-')[0])").Build).$(_MvvmToolkitWindowsSdkPackageMinBuild) + 10.0.$([System.Version]::Parse("$(WindowsSdkPackageVersion.Split('-')[0])").Build).$(_MvvmToolkitWindowsSdkPackageRecommendedBuild) @@ -38,6 +51,7 @@ Condition="'$(WindowsSdkPackageVersion)' == '' AND '@(ResolvedFrameworkReference)' != '' AND '%(Identity)' == 'Microsoft.Windows.SDK.NET.Ref'"> %(ResolvedFrameworkReference.TargetingPackVersion) 10.0.$([System.Version]::Parse("%(ResolvedFrameworkReference.TargetingPackVersion)").Build).$(_MvvmToolkitWindowsSdkPackageMinBuild) + 10.0.$([System.Version]::Parse("%(ResolvedFrameworkReference.TargetingPackVersion)").Build).$(_MvvmToolkitWindowsSdkPackageRecommendedBuild) @@ -47,8 +61,9 @@ - + <_MvvmToolkitWindowsSdkPackageRequired>@(_MvvmToolkitWindowsSdkPackage->'%(Required)') + <_MvvmToolkitWindowsSdkPackageRecommended>@(_MvvmToolkitWindowsSdkPackage->'%(Recommended)') @@ -56,7 +71,7 @@ Condition="'@(_MvvmToolkitCompatibleWindowsSdkPackages)' == ''" Code="MVVMTKCFG0003" HelpLink="https://aka.ms/mvvmtoolkit/errors/mvvmtkcfg0003" - Text="This version of the MVVM Toolkit requires 'Microsoft.Windows.SDK.NET.Ref' version '$(_MvvmToolkitWindowsSdkPackageRequired)' or later. Please update to .NET SDK 8.0.109, 8.0.305 or 8.0.402 (or later). Alternatively, use a temporary 'Microsoft.Windows.SDK.NET.Ref' reference, which can be done by setting the 'WindowsSdkPackageVersion' property in your .csproj file to '$(_MvvmToolkitWindowsSdkPackageRequired)'." /> + Text="This version of the MVVM Toolkit requires 'Microsoft.Windows.SDK.NET.Ref' version '$(_MvvmToolkitWindowsSdkPackageRequired)' or later. Please update to .NET SDK 8.0.109, 8.0.305 or 8.0.402 (or later). Alternatively, use a temporary 'Microsoft.Windows.SDK.NET.Ref' reference, which can be done by setting the 'WindowsSdkPackageVersion' property in your .csproj file. For your project configuration, it is recommended to set the package version to '$(_MvvmToolkitWindowsSdkPackageRecommended)'." /> \ No newline at end of file