Developers here have different SDKs installed, I want my Visual Studio projects to use any available SDK greater than 10.0, without the need to specify exactly which one. Is there a way to do this?
In the vcxproj file:
<WindowsTargetPlatformVersion>10.0.10586.0</WindowsTargetPlatformVersion>
For Visual Studio 2017, you must use a specific SDK version number in your vcxproj file. However there is a workaround by Antonio Sanchez for the Windows 10 SDK in the comments of this post: https://developercommunity.visualstudio.com/comments/190992/view.html
<PropertyGroup Condition="'$(WindowsTargetPlatformVersion)'==''">
<!-- Latest Target Version property -->
<LatestTargetPlatformVersion>
$([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0'))
</LatestTargetPlatformVersion>
<WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)' == ''">
$(LatestTargetPlatformVersion)
</WindowsTargetPlatformVersion>
<TargetPlatformVersion>
$(WindowsTargetPlatformVersion)
</TargetPlatformVersion>
</PropertyGroup>
For Visual Studio 2019, you can specify the most recent version of the Windows 10 SDK by using a value of 10.0. For example:
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
The current design requires your vcxproj contain a specific version number.
Since your project is for VS 2017 (based on the v141
platform toolset), there's no reason to use something as old as 15086. If someone installs a fresh copy of VS 2017 today (15.9 update), they will have the Windows 10 SDK (10.0.17763) by default. The only time they would have 10.0.15806 installed by default is if they had installed VS 2017 (15.1 update) and never updated it.
The only time it makes sense to stick with an older Windows 10 SDK in a vcxproj is for VS 2015 projects because 10.0.14493 was the last release that officially supports VS 2015.
Remember also that for Win32 desktop applications, the Windows 10 SDK (17763) still targets the same versions of Windows that the Windows 10 SDK (15086) did: Windows 7 SP1, Windows 8.x, Windows 10.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With