Breakpoints Not Working - Visual Studio 2022 Mixed Mode Debugging
MaxNastri opened this issue · 5 comments
While running the example c++ application, it looks like breakpoints are skipped over entirely. Turning the mixed mode debugging project setting back to native only seems to fix the issue. Is this a known issue?
Hmm that's strange, it seems like in those projects it only hits breakpoints in native code after the .NET Runtime has been initialized.
Unsure why that is, in theory Mixed mode should simply allow us to debug both native and managed code. Might be a bug with Visual Studio, might be some other setting being incorrect. I'll look into it, unfortunately we need mixed mode debugging to debug the managed code, so this is definitely something that needs fixing
I can confirm on my end that breakpoints do start functioning as soon as hostInstance.Initialize is finished executing, same behavior as what you described. Thanks for looking into it!
I can confirm on my end that breakpoints do start functioning as soon as hostInstance.Initialize is finished executing, same behavior as what you described. Thanks for looking into it!
I'll keep investigating this, although my suspicion is that this is a flaw with the Visual Studio debugger, and not something that I can easily fix.
Currently the debugging situation isn't great regardless, mainly because if you have your C# code in a separate solution to the host program you can't run the host with a debugger attached if you then want to debug your C# code nicely.
I'll continue looking into it however.
No worries! For my use case, I can use the workaround of initializing .NetCore first thing in the application to let breakpoints work after.
@peter1745 I'll go ahead and close out this issue since the workaround is sufficient for my needs. Like you said, this is most likely a VS2022 issue so likely to go unsolved. Thank you for taking a look!