Visual Studio creates files at wrong place

Hi guys.

I just started developing with Unreal Engine 5.1 and Visual Studio 2022. I have many years of programming experience, but not so much with Unreal, VS and C++.
I generated the VS files using Unreal as described in several tutorials. When I open the project in VS, the solution explorer shows me sth like this (I’ve also dragged around some files already trying to solve the problem):


Now when I want to add a source file (.h or .cpp) to the “Source” folder, I would expect it to appear in the “Source” folder in the Windows Explorer as well. But it does not; instead it appears in Intermediate/ProjectFiles. Having those files there seems to make it impossible to #include them without adapting some config (e.g. adding the Intermediate folder to some build source list). I’m pretty sure, this is not how it’s supposed to be; can you give me advice of how to fix it? :face_with_monocle:

PS: I am very new to this environment, so feel free to complain about what ever other details catch your eye. :grin:

Hi Brokkoli3000,

You can add classes to your project from within UE:

Otherwise, you can create the files in FileExplorer in the correct folder and then manually add them to your VS solution.

Ah ok, that works. A bit of a workaround, because imo it should work in Visual Studio, too. But yeah, then I’m gonna continue like this. Thank you! :slight_smile:

1 Like