How to target VS2017 from .uproject

I was able to generate the UE4.sln using GenerateProjectFiles.bat -2017
The generated UE4.sln is targeted for VS2017, which is fine.
I rebuilt the solution.

Now, I’d like to generate my project for VS2017.
When I right-click the .uproject file, and Generate Visual Studio project files, my project .sln is still targeted for VS2015.

First, there is a way to target the generation for VS2017.

Then I tried to open the .sln using VS2017.
As shown below, the projects included in the solution is still in VS2015


This is strange since even the UE4 is targeted for VS2015.

Thanks for your help.

Finally I found how to do.

I took another project, launch the editor. Go to Editor Settings → Source → Sets to Visual Studio 2017.
It generates a DefaultEditorPerProjectUserSettings.ini in the Config directory.
Copy this file to the Config directory of the project.
Then, right click on the uproject file and Regenerate source code.
The project is now targeted to Visual Studio 2017.

Seems it doesnt work for 4.18?
It now generates BaseEditorPerProjectUserSettings.ini in engine/config, if I copy to my project config folder even with this name or as suggested DefaultEditorPerProjectUserSettings.ini, still generates VS 2015 files…

Another way to do it in 4.18, since I did it recently.
If you use the engine from the source code. After having generated the solution for the engine using GenerateProjectFiles.bat -v2017
open the solution, it should open using VS 2017.
Compile the engine and launch the editor from VS 2017. Open or create a project. Change the Visual Studio to Visual Studio 2017 in the preferences. Close the editor.
Now you can right click on your uproject file and regenerate the solution.
By clicking on the project sln file it should open the VS 2017.

You can also look at the command that is executed when generating the Visual Studio projects, and add -2017 to it. For instance:

D:/UnrealEngine/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project="D:/MultiplayerShootout/MultiplayerShootout.uproject" -game -engine -progress -2017

If you, like me, are not building the engine yourself but are still using the launcher, and want to retarget your game to build with VS2017 instead of VS2015 (and already have VS2017 installed but are getting errors saying that the project needs to be built with VS2015 and/or cannot find the VS2017 install), the rough steps I did to resolve this were:

  • Select Visual Studio 2017 in Editor Preferences → Source Code
  • Uninstall VS 2015 using the Control Panel (‘Change’ → Uninstall)
  • Use the Visual Studio Uninstaller at Releases · microsoft/VisualStudioUninstaller · GitHub
  • Reboot
  • Use the Visual Studio Installer to Repair the VS2017 installation
  • Generate Visual Studio Project Files by right clicking on the .uproject

If I didn’t do the VS2017 repair then the Unreal Build Tool couldn’t find the VS2017 installation. Afterwards however it worked fine and will now correctly open VS2017 instead of VS2015.

Fixed it for me!

Accepted answer didn’t suit me because even after having set 2017 in the editor and uninstalled VS2015, UE was still searching for it instead of 2017. I think using the Visual Studio Uninstaller and repairing VS2017 are key for this to work.

I also wanted to avoid dealing with command line if possible.