Debug on VS not stopping on breakpoints

Try to use :

#pragma optimize("", off)


#pragma optimize("", on)

I’m experienced in C++ and interactive debugging but I can’t make this work in UE4.
I followed the tutorials around.

  • Set Solution config in VS to Debug Game Editor mode. (I guess it’s the new Debug Editor)
  • Set some breakpoints in the code
  • Associate a debugging setion to the UEEditor.exe. (Debug → Associate. No idea how that is in english)
  • Hit play on the game

Not stopping at all in there, and I know it’s executing that. Anything I’m missing here?

Found this. Could this be a problem?

Not working!

Are you running from Visual Studio or launching through your .uproject?

I’m opening VS double clicking my class in the content panel.

In order to debug with Visual Studio, go to your project folder and open the .sln, by double clicking on it:


This will open Visual Studio. Make sure on the top bar you have Debug/Development Editor selected. Win64. And the project name should be listed as well (by default). Then press the “Local Windows Debugger” button. This will launch your projects editor, where you can then use PIE to debug through your classes using Visual Studio:

make sure that the line you put your breakpoint in isnt trivial, so it doesnt get optimized out.
if you let your function return something, you should be able to put a breakpoint on the opening bracket for your function body definition

I tried and noticed that when using local windows debugger, the SLN opens a new instance of UE4. But not the latest I have, and older version of it.

Also, I have no field with the name of the project before that green Play button. But the debugger is stopping, so, it’s nice!

If you move this comment to be an answer, I’ll it as answered. Thanks!

Yeah, as I said, I have enough experience on interactive debugging, so yeah, that’s the first thing I tested. Thanks!

worked for me

and me, cheers!

Thanks, this did the trick and that confirms that optimization is the issue and there is definitely no better way than to follow this suggestion in order to only affect a section. Live coding works with this too.

Hi, I get build failed when pressing the ‘play Local Windows Debugger’ with several errors in CoreNet.H and Texture.H, clearly nothing releated to my code. Any help?