Search Issue Tracker

Won't Fix

Votes

0

Found in

2018.4

2019.2

2019.3

2019.3.0a7

2020.1

Issue ID

1166311

Regression

No

Windows Build creates a VS Solution for VS2015 even when this version is not installed

Windows

-

Repro steps:
1. Create a new Unity project
2. Make sure that Scripting Backend in Player Settings is set to IL2CPP
3. In File > Build Settings, enable Create Visual Studio Solution
4. Build the project
5. Open the Visual Studio Solution file, located in the built project's directory

Expected results: Visual Studio Solution is created for the latest version of Visual Studio that's installed on the computer
Actual results: A prompt saying that the following projects use an earlier version of the Visual C++ platform toolset is thrown

Reproducible with: 2018.4.0f1, 2018.4.17f1, 2019.2.0a1, 2019.2.21f1, 2019.3.0a1, 2019.3.3f1, 2020.1.0a1, 2020.1.0a24
Could not test with: 2017.4 due to being unable to set IL2CPP as Scripting Backend

UPDATE:

The MSVC Platform Toolset (essentially the C++ compiler) is a separate component from the actual Visual Studio installation. While each VS release will install it's own version of the Toolset, it's possible to install other Toolset versions independently of the VS release. See this MS blog post for details on side-by-side installations of MSVC: https://devblogs.microsoft.com/cppblog/side-by-side-minor-version-msvc-toolsets-in-visual-studio-2017/

As for Unity, the Visual Studio project generator for WindowsStandalone is very basic (compared to the one used for UWP projects) and currently hard codes the MSVC Toolset version as "v140", which is the toolset used by Visual Studio 2015 (minimum supported version). That is, it doesn't configure the project according to your current Visual Studio installation. So, if you don't have MSVC v140 installed, you'll receive build errors in VS.

To work around this limitation:

- Allow Visual Studio to automatically update your project
When you first open the new VS Solution, you should receive a prompt stating the project uses and older toolset and asks if you'd like to update. Click "OK" and the project will be updated to your currently installed toolset.

- Install the v140 Toolset
In the Visual Studio Installer, select "Individual Components" and check the Toolset option to install:
(VS 2019) "MSVC v140 - VS 2015 C++ Build Tools (v14.00)"
(VS 2017) "VC++ 2015.3 v1400 (v140) toolset for desktop"

NOTE: Exact text may vary depending on which update of VS you're currently on.

- Manually update the toolset through the project settings
Follow these instructions for MS docs: https://docs.microsoft.com/en-us/cpp/build/how-to-modify-the-target-framework-and-platform-toolset?view=vs-2019#to-change-the-platform-toolset

You'll need to update these projects using this method
- The main "app" project
- UnityPlayerStub

For Il2cppOutputProject, this option doesn't appear in the UI (because it uses a Makefile) and instead you'll have to edit the project XML directly:
1. Open the "Il2CppOutputProject.vcxproj" file in a Text Editor
2. Find the "<PlatformToolset>v140</PlatformToolset> tag
3. Change "v140" to the toolset version you have installed, e.g. v141 or v142

  1. Resolution Note (2020.1.X):

    We won't be addressing this issue at this time, but instead it'll be considered as part of our ongoing integration and workflow improvements.
    Please see the "Update" section in the description for details on work-arounds.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.