C++ classes not registering on open, have to rebuild code and reload all code base assets

I’m relatively new to the C++ side on Unreal and I’m taking some classes on it, but I’ve been running into a problem that I’ve been dealing with but would like fixed. Regardless of how I open the project (opening from Epic Games, opening from file, opening UE then opening the project), my C++ classes will be missing. This doesn’t include any from a template, just the ones I make.

I’m able to solve this by just rebuilding, but since the classes were missing at the start, any blueprints that use C++ don’t work, so I have to reload each asset or else either it doesn’t appear in game, or the engine will crash if I use something that had code. It’s not so bad for these classes because the amount of assets is small enough that I can just reload them all, but it’s stopping me from wanting to work more on it.

Am I doing something wrong or is something wrong with my engine or Visual Studio? I’d like to learn how to use C++ for Unreal but this is making me just want to stick to blueprints at the moment.

Info:

Engine version: all versions of UE5 have this problem for me, haven’t tried UE4

VS version: 2022

How I start project: new project, switch to C++, create

Live coding is enabled but I’m not sure of the alternatives.

How are you rebuilding? From the options that you’re using to open your project you’re missing the one that is generally the workflow for C++: running from your IDE. You should have your solution/uproject open in your IDE of choice (likely Visual Studio or Rider) and then compile and run from there. This should open directly into the editor for your project.

The short version is only Live Code when changing function bodies. Just about anything else, including adding new classes, requires closing the Editor, building and relaunching. Long answer has a good writeup here.

this may be the problem, make sure you start with a c++ project. adding c++ to blueprint project has caused your problem for me in the past