December 28, 2022

372 words 2 mins read

Unreal Engine 5 VSCode on Windows 11 Setup

Unreal Engine 5 VSCode on Windows 11 Setup

Solutions to small issues I experienced setting up vscode for Windows 11 as the source code editor for Unreal Engine 5

For the most part, I followed the official Unreal Engine 5 documentation to get vscode setup as the source code editor for all of my Unreal Engine projects.

However, the documentation was loose on details around the “Installing the Compiler Toolset” step. It said to download and install Built Tools for Visual Studio 2022, but did not indicate which tools within to install (installing all of them would be silly).

The Compile Time Issues

'dotnet' is not recognized as an interal or external command

and

Invalid access to memory loation

The first error was simple enough to diagnose. It’s telling us that it can’t run dotnet because there isn’t a path for it. The second one was trickier, dotnet was recognized but the .NET SDK was not installed.

The Solution

Initially, I had just installed the C++ build tools in ‘Build Tools for Visual Studio 2022’.

I installed the the first option, Desktop development with C++, which installed MSVC
Build Tools SDK Workloads

I installed the the first option, Desktop development with C++, which installed MSVC

After the install, it could find dotnet however after running dotnet --info, no SDKs were available.

No SDKs available

I could not figure out what individual components to add in to include the Build Tools installer, I tried including .NET SDK component, as well as other runtimes, but it still did not work.

So I opted to install the SDK outside of the build tools launcher at the official Microsoft website. I went with the latest, SDK version 7.0.1.

The installer should automatically include dotnet in the path, but in the event it doesn’t you can manually add it in.

Searching ‘Environment Variables’ on windows brings up this tool
Win11 Environment Variables - Paths

Searching ‘Environment Variables’ on windows brings up this tool

Intellisense

From the official documentation, Epic says to add this JSON property to .vscode/c_cpp_properties.json:

"includePath": [ "${workspaceFolder}\\Intermediate\**", "[Workspace Folder]\\Plugins\**", "[Workspace Folder]\\Source\**" ],

But on its own is invalid JSON.

${workspaceFolder} is not a placeholder, but an actual variable to the root workspace folder. But in the subsequency items in the array, its represented by angle brackets instead.

Also, it does not escape the second directory’s backslash.

Mine looks like this:

"includePath": [ 
    "${workspaceFolder}\\Intermediate\\**",
    "${workspaceFolder}\\Plugins\\**",
    "${workspaceFolder}\\Source\\**" ]