New projects use wrong Visual Studio version upon creation

When creating a new C++ project it’ll always fail because it attempts to use VS2017 instead of 2019.
I checked the RegKey Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\devenv.exe and it is correctly set to 2019. But Unreal Engine selects 2017 for some reason when creating new projects and there is no option to select the VS version when creating a new project…

Error when attempting to create a new project:

Running C:/Program Files/Epic Games/UE_4.23/Engine/Binaries/DotNET/UnrealBuildTool.exe Development Win64 -Project="D:/Unreal_Projects/MyProject/MyProject/MyProject.uproject" -TargetType=Editor -Progress -NoHotReloadFromIDE
Creating makefile for MyProjectEditor (no existing makefile)
@progress push 5%
Parsing headers for MyProjectEditor
  Running UnrealHeaderTool "D:\Unreal_Projects\MyProject\MyProject\MyProject.uproject" "D:\Unreal_Projects\MyProject\MyProject\Intermediate\Build\Win64\MyProjectEditor\Development\MyProjectEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
Reflection code generated for MyProjectEditor in 6.7640515 seconds
@progress pop
Using Visual Studio 2017 14.11.25503 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503) and Windows 10.0.16299.0 SDK (C:\Program Files (x86)\Windows Kits\10).
Building 9 actions with 8 processes...
  @progress 'Compiling C++ source code...' 0%
  @progress 'Compiling C++ source code...' 11%
  [1/9] Default.rc2
  @progress 'Compiling C++ source code...' 22%
  [2/9] SharedPCH.Engine.cpp
  c:\program files\epic games\ue_4.23\engine\source\runtime\core\public\Windows/WindowsPlatformCompilerSetup.h(21): error C2338: Visual Studio 2017 version 15.6 is required to compile on Windows. Please install updates through the Visual Studio installer.

I also tried to add :

[/Script/WindowsTargetPlatform.WindowsTargetSettings]
Compiler=VisualStudio2019

To DefaultEditor.ini after the project creation fails, I delete the .vs folder and the .sln file and then I recreated the VS files from right-clicking the *.uproject file but it will just generate VS2015 files again. What am I missing?

Also, I can’t open the Editor (because it’s not built) so I can’t change anything through the editor.

From Epic’s documentation:

As of version 4.22, Unreal Engine does not support VS 2015. Unreal Engine still uses VS 2017 by default, but also supports VS 2019.
For blueprint projects you can apparently just change it in the editor itself (after creating it) but how to change the default engine from the editor if you can’t even compile the editor?

Is there an option during project creation that I missed or something? I mean obviously there’s such option somewhere prior to project creation, right?

Also a bit off-topic but I noticed that if you try to cancel the compilation of a new proect, you can’t. I believe that Epic put the compilation on the same thread as the UI with the cancel button thus it’s ‘frozen’ and you can’t click it. I assume this is a bug.

I solved it. Looks like a bug. Steps to solve:

  1. First create a blueprint project and change the editor to 2019 and then close this project.
  2. Update VS 2017 to the latest version if it isn’t already.
  3. Create your new C++ project as normal.

Apparently UE4 underwater (for me) uses VS2017 to compile and then after the project has been created it’ll startup (and use) 2019.

As a result: using an older version of 2017 that’s not compatible with UE4 anymore will fail the project compilation. Ofcourse I ask myself: why UE4 does not check this BEFORE allowing me to create a project, nevermind allowing me to chose the VS version also BEFORE project creation… So you’ll have to update VS 2017 to the latest version even though you’ll never use it for UE4.

1 Like

thank you.