Solution to Unreal problem with Visual Studio Code

The problem :

You choose Visual Studio Code in “Editor preference” > “Source code” but when you generate the code, Unreal doesn’t create the vscode folder in your project and when you open your C++ class with VSCode, your #include headers have the red underline and nothing works.

The solution :

  1. Go to C:\...\...\AppData\Roaming\Unreal Engine\UnrealBuildTool
  2. Open BuildConfiguration.XML
  3. Replace the code by :
<?xml version="1.0" encoding="utf-8"?>
<Configuration xmlns="">
  1. Save the file
  2. Right-click on your Unreal project file and Generate your project.

Unreal will now create the .vscode folder and all the files inside.
Visual Studio Code can now be used with Unreal.

If you have an editor available (ie, you’ve built it in the past, or are using a pre-built one) I believe the preferred method is to use File->Generate Project Files in editor. I haven’t seen the right-click on .uproject option work in a number of years.