Unreal opening command prompt instead of Visual Studio

Whenever I attempt to open a cpp file with in unreal, the bottom right of the screen has a pop up stating opening visual studio 2019. However it opens up a command prompt set in one of my various hard drives. It never opens up VS. Before this I had VS2015 installed and it use to open that despite having VS2019 set as my editor in the settings as well as in the .ini file. Once I uninstalled 2015 this problem started happening. I have used the command prompt to open VS2019 but the engine does not register it as being open.

It’s weird, because if you are using UE4 version 4.22 it does support VS2019 by default.
Try to go to
“YourProjecte/Config/DefaultEditorPerProjectUserSettings.ini”
and check if there’s anything along the line of

PreferredAccessor=VisualStudio2019

If not, add this to the file:

[/Script/SourceCodeAccess.SourceCodeAccessSettings]
PreferredAccessor=VisualStudio2017

And save it.

In case it doesn’t work anymore the second time you open the project, try redoing the above configuration and set the file to read only.
Hope that helps!

I had a same problem. Just formatted my PC, and I followed some tutorial step to install VS code and the tutorial includes installing the VS buildtools which is apparently get installed once more if you install vs2019 afterward,
to fix it, I launched the VS installer, then proceed to uninstall everything on the installed tab, restart the computer, then reinstall the VS2019 checking only the required workload (for gaming). UE4 now launch VS2019 properly.

For your case, perhaps try launching VSinstaller and see if there’s overlapping buildtools installed, for me the telltale was VS2019 was installed with a suffix"(2)".

1 Like

i just opened vs installer and it worked after that . “MAGIC” . Dunno what is wrong