Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio debugger isn't attaching

I'm having two problems which center on the debugger. I'm not sure if they share the same cause but they definitely seem related.

  1. When I open my solution in Visual Studio Enterprise 2015, I get this message: Automatically attaching to support this behavior was not completely successful
  2. When I start the program directly from the executable and try to attach to the process in visual studio, I get this message: Unable to attach to the process. No more data is available.

After dismissing the message box I get in step 2, the IDE definitely thinks it's attached to something. The Debug toolbar shows active Break All and Stop Debugging buttons and I can select Debug > Detach All. It's not hitting any of the breakpoints I set.

Per Jeremy's answer, I went to Debug > Windows > Modules and it showed nothing in the list. The debug output also immediately says the program exited with code 0 (bottom left of that screen cap).


The following are related questions and answers I've come across. None of the posted solutions worked.
  • This question is only kind of similar and I set VS to always run as administrator.
    • This answer to that question led me to modify the Debug Programs policy in User Rights Assignment to include my account. It previously only included the Administrators group which my account is part of but I took a shot.
  • This question is similar to bullet 1 above. My Visual Studio is completely up-to-date. I also tried enabling SQL Server debugging as some of the answers suggested but that didn't do anything.
like image 878
Jason Avatar asked Oct 19 '22 10:10

Jason


1 Answers

It's going to be something like:

  1. The Symbols aren't loaded. Debug menu > Windows > Modules and confirm

  2. There are no pdb files. Check you're building in Debug Mode

  3. Goto Project properties > Debug > check the settings and Enable Visual Studio Hosting Process is ticked

  4. Goto Project properties > Advanced Build Settings and make sure Debug Info is set to Full

  5. Also check the import settings wizard (if you're missing menus):

enter image description here

  1. The wow64 emulation layer that allows 32-bit code to run on the 64-bit version of Windows 7 swallows exceptions in the code that runs in response to a notification generated by the 64-bit window manager, like the Load event. Preventing the debugger from seeing it and stepping in. https://stackoverflow.com/a/4934010/495455
like image 174
Jeremy Thompson Avatar answered Oct 21 '22 05:10

Jeremy Thompson