How to set the Visual Studio version?

Hi,
I have VS2015 and VS2017 installed but Unreal 4.18 generates always only VS2015 solution files. Visual Studio 2017 got installed first and I installed Visual Studio 2015 later to open an old Unreal 4.13 project.

How can I select the Visual Studio version I want to work with?

Thanks

Go to Edit->Project Settings-> Platforms-> Windows → Toolchain ->CompilerVersion. You can switch between Visual Studio 2015 or 2017.

4 Likes

Thanks. That is exactly what I’m looking for. I must have overseen it when I checked the settings. … But it seems to have no effect. I have now VS2017 set as compiler but Unreal still generates VS2015 solution files.

Got the same problem, selected VS2017 but still opens 2015.

Hi, I’m having the same issue on 4.18.2. Is this a known issue yet?

I’m also having this issue, changing the setting to 2017 in a fresh project then adding my first C++ class sets the compiler version to 2015.

So… apparently there is an ENGINE setting (under Edit->Editor Preferences) as well as a PROJECT setting for this. Changing the PROJECT setting then rebuilding the Visual Studio project only did not work for me until I also changed the ENGINE setting. The engine setting is under the “Source Code” section.

3 Likes

To Disambiguate: He’s talking about the engine settings under Edit → Editor preferences → General → Source code

Reason I comment this is that I was looking for a source code area under the Engine tab, in the PROJECT settings - which didn’t exist :slight_smile:

3 Likes

You should change the editor in Edit > Editor Preferences > General > Source Code > Source Code Editor

I had to change both the Engine and Project preference settings as stated in other comments. Then completely close out of my game project (i.e. close UE4 completely). Then “Regenerate project files” (or whatever that’s called I forget) in the project folder on the disk. After generating project files, then I was able to reopen my game project in UE4 and Unreal finally started using Visual Studio 2017 for me (instead of 2015)!

1 Like

There is no need to compile the editor just to change the compiler setting. In your project directory update the following files:

File: Config/DefaultEngine.ini

[/Script/WindowsTargetPlatform.WindowsTargetSettings]
Compiler=VisualStudio2019

File: Config/DefaultEditorPerProjectUserSettings.ini

[/Script/SourceCodeAccess.SourceCodeAccessSettings]
PreferredAccessor=VisualStudio2019

That should let you compile with your chosen version of visual studio instead of doing it twice.

I’m trying to upgrade my VS version from 2017 to 2019, See attached image on how I have attempted to change the engine version.

After Changing “Source Editor” and “Compiler Version” to Visual Studio 2019 in the Editor I restarted and regenerate the Visual Studio project files but they still come back as VS 2017.
I’m using a source-built version of the engine, does that have implications? if so how do I change Code Editor on a source-built version of the engine?

The answerhub is broken for me so I’m asking here :expressionless: This question was the closest to my question

I am running UE 5.2 My VS solution file opens in VS 2019 and the Lyra Starter Game sample project is incompatible with that version so I need it to open the solution in 2022.

I applied changes as per above, modifying project settings and editor preferences. I then checked and modified the files DefaultEngine.ini and DefaultEditorPerProjectUserSettings.ini as indicated above. I rebuilt the project. Still opens in 2019.

I can get round the problem by right clicking the solution file, choosing “Open with” and then selecting the VS version I need but I would like to know what I am missing. Does anyone else have this problem?