Search Unity

Any option to set Platform Toolset and Windows SDK version with Visual Studio project generation

Discussion in 'Windows' started by shrey-malhotra, May 28, 2022.

  1. shrey-malhotra

    shrey-malhotra

    Joined:
    Jan 27, 2013
    Posts:
    11
    Hi folks,

    I am using this https://docs.unity3d.com/Manual/VisualStudioprojectgenerationWindows.html to generate a VisualStudio Project.

    However, the SDK version and toolset that Unity uses are older than the one I like to use with Visual Studio. I used the retarget solution window the first time, but then with every build after that, it resets back to the old version. I have to then reopen the solution and retarget it again (or change it manually).

    Is there any way to set these in Unity or force choose the latest available SDK and Toolset?

    I am on Unity 2020 LTS
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    We don't have a way to set it unfortunately. What you can do is write a script that after the build is complete, does File.ReadAllText/string.Replace/File.WriteAllText to change the target version to whatever you want it to be.
     
  3. shrey-malhotra

    shrey-malhotra

    Joined:
    Jan 27, 2013
    Posts:
    11
    Got it, thank you for the tip. I made a PowerShell script and used that to modify the project files and call MSBuild.exe.