Help running in Visual Studio debug mode (cooked content problem)

How do I run the game from Visual Studio in debug mode? I know this has been asked before, but none of the responses seem to work for me. This is my first time using UE, trying to port a game to evaluate UE for our project.

I thought all I need to do is build/run the ‘DebugGame’ solution configuration with ‘-debug -game’ option given the executable file. This is what I did: From Visual Studio, select “DebugGame” solution configuration. In the game project’s property page, under “Configuration Properties/Debugging”, under “Command Arguments”, I add “-game -debug”. Then clean, rebuild all, run in debug mode (menu “Build->Clean Solution”, “Build->Rebuild Solution”, “Debug->Start Debugging”). This doesn’t work for me, I still get an error saying it can’t find ‘COOKED’ content.

Alternatively, I thought I should be able to ‘cook’ the content. From the Unreal Editor, I select “File->Cook Content for Windows”, but after a while I get a failure message, and the log files ends with “RunUAT.bat ERROR: AutomationTool was unable to run successfully” “BUILD FAILED”.

Ref 1: Cooking Content in Unreal Engine | Unreal Engine 5.1 Documentation
Ref 2: How do I debug standalone game? - Debugging, Optimization, & Profiling - Epic Developer Community Forums

What am I doing wrong?

Hello mybigspamemail,

Running things in debug isn’t something I’ve had to do much, other than running the editor itself in debug, but the method that I’m accustom to using is building for DebugGame, packaging the game for DebugGame and “Include Debug Files” checked, which can be found in the Project Settings in UE4 under Packaging. After that, return to VS, add the -debug -game command arguments and then change the Working Directory to the “WindowsNoEditor” folder (or the root folder) for the packaged project. After this, you should be able to debug through the “Start New Instance” option when right-clicking the project in VS.

I’ll be looking into if there is a quicker way that doesn’t involve packaging because, as I stated, this isn’t quite my forte.