Hello,
I’m trying to debug my Unreal Engine 5 project using Visual Studio, but the debugger is not working properly when attaching to a Standalone Game. Here’s what I’m experiencing:
- Visual Studio version:
- Microsoft Visual Studio Professional 2022 (64-bit) - Current
- Version 17.12.5
- Engine versions:
- The issue occurs both with the Epic Games Launcher version and the source-built version of the engine (5.5.4 from GitHub).
- Launch method: Run the editor with the
DebugGameEditor
configuration, then play using Standalone Game
- Launch argument: When using
-waitforattach
, Visual Studio freezes after attaching
- If I don’t use
-waitforattach
, the debugger does not catch or respond at all
- Note: The same issue occurs even when testing with the official Lyra sample project, so it doesn’t seem project-specific.
Confirmed settings:
- Visual Studio options “Enable Just My Code” and “Require exact source match” are both disabled.
Is there any known reason this setup would prevent debugging from working? Are there additional settings I should check?
Thank you in advance!
재현 방법
To test this, you can use the Lyra project.
After setting
DebuggerMaxModuleMsgs to 2048 under
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
, Visual Studio started freezing even without using -waitforattach
Hi,
I tried it and I can debug. But I have an older VS version:
Microsoft Visual Studio Professional 2022 (64-bit) - Current
Version 17.9.6
Here what I did to be sure that’s what you are doing:
[Image Removed]Then I attach to the process from VS
[Image Removed]The debugger breaks in the GuardedMain as expected.
[Image Removed]
Did you check how much RAM were used when you do that? It use ~36GB for me. Maybe the debug game + Editor consumes too much RAM or the latest VC++ debugger has an issue? I have pretty much the default debugger settings, but like you I have ‘Enable Just My Code’ for when I debug C# code… I’m considering upgrading VS tomorrow to see if I can reproduce. In the meantime, just check my screenshot and ensure I’m doing it like you.
Regards,
Patrick
Hi,
Today I upgraded Visual Studio to the latest version which is ahead of yours and I was able to attach the debugger. You can try upgrading to 17.13.6 like I did and see if that fix the problem. Otherwise, ensure you attach using ‘Native code’ as code type.
Microsoft Visual Studio Professional 2022 (64-bit) - Current
Version 17.13.6
I exported my debugging settings from VS menu (Tools -> Import and Export settings… -> Export selected environment settings -> Options -> Debugging). That’s an XML file. I formatted the content in VS (Edit -> Advanced -> Format Selection). Here my settings if you want to compare… in case something is different:
Let me know if you finds something.
Regards,
Patrick
hi Patrick
Yes, I did it the same way as you.
As you suggested, updating Visual Studio resolved the issue. Not sure if other problems will pop up later, but… well, I’ll reach out again if something comes up, haha. Thanks a lot, Patrick!