microsoft / WindowsAppSDK

The Windows App SDK empowers all Windows desktop apps with modern Windows UI, APIs, and platform features, including back-compat support, shipped via NuGet.
https://docs.microsoft.com/windows/apps/windows-app-sdk/
MIT License
3.8k stars 320 forks source link

Incorrect WindowsTargetPlatform[Min]Version in *.vcxproj #445

Open DrusTheAxe opened 3 years ago

DrusTheAxe commented 3 years ago

Almost(!) everything in Reunion's consistent

1x; dev\MRTCore\mrt\Microsoft.ApplicationModel.Resource

   <WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.18362.0</WindowsTargetPlatformVersion>
    <WindowsTargetPlatformMinVersion>10.0.17134.0</WindowsTargetPlatformMinVersion>

2x: test\DynamicDependency\data\Framework.Math.Add + Framework.Math.Multiply

    <WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
    <WindowsTargetPlatformMinVersion>10.0.17763.0</WindowsTargetPlatformMinVersion>

20+ (everyone else)

   <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>

The 2x (Framework.Math.*) are the only correct ones?

All the project files should be in sync.

Also, this is waaay too manual to ensure it stays correct. Can we add something to PRojectReunion.props that verifies this @ build-time and fails if values aren't as expected?

DrusTheAxe commented 3 years ago

P.S. <PlatformToolset> has a similar problem

Almost(!) all *.vcxproj in Project Reunion say

    <PlatformToolset>v142</PlatformToolset>

Only exception is dev\MRTCore\mrt\mrm\UnitTests\BaseUnitTests.vcxproj

    <PlatformToolset Condition="$(VisualStudioVersion) &gt;= 16.0">v142</PlatformToolset>
    <PlatformToolset Condition="$(VisualStudioVersion) &gt;= 15.0 and $(VisualStudioVersion) &lt; 16.0">v141</PlatformToolset>
    <PlatformToolset Condition="$(VisualStudioVersion) &lt; 15.0">v140</PlatformToolset>

and the similar-but-different dev\MRTCore\mrt\Microsoft.ApplicationModel.Resources\src\Microsoft.ApplicationModel.Resources.vcxproj

    <PlatformToolset>v140</PlatformToolset>
    <PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
    <PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
dhoehna commented 3 years ago

@DrusTheAxe something like this: https://github.com/microsoft/ProjectReunion/tree/user/ToolsetAndWindowsVersionMismatch/AddingToProps

I moved both the Platform Toolset and Windows' version stuff to the prop file. I have also changed all vcxproj files to use this property sheet. I haven't tested to make sure anything build yet.