Navigation

    ViGEm Forums

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Twitter
    • GitHub
    • Discord

    Automatically select latest Windows 10 SDK

    Research and Development
    1
    1
    296
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • nefarius
      nefarius last edited by

      In the project file (*.vcxproj) remove or comment out the WindowsTargetPlatformVersion property:

      <PropertyGroup Label="Globals">
        ...
        <!-- <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion> -->
      </PropertyGroup>
      

      Add this new property group which gets evaluated by VS/MSBuild to the latest installed SDK version:

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

      Credits

      Stolen from here 😉

      1 Reply Last reply Reply Quote 0
      • First post
        Last post