Visual Studio disconnects from the application as soon as debugging begins

I have a web application that I could always run in Visual Studio, and it is perfectly debugging (breakpoints work, I can pause execution, etc.). Recently, behavior has unexpectedly changed, and several things have happened:

  • I run debugging, it launches IE and loads the application, but after a few seconds (sometimes the page still does not appear) Visual Studio works as if debugging is stopped - I can edit the code in VS again, and the Play button on the toolbar included. The application continues to run in the IE window that just appears, but I'm not tied to it.
  • For a few seconds, when VS is "debugging" because it is detaching, my breakpoints are displayed as hollow - as if I am set to "Release" and they will not be deleted. In fact, I have a breakpoint set to Page_Load and it skips right. I checked and I am set to debug mode, although there is no compilation mode drop-down list on the toolbar (I checked the build properties to make sure I was in debug mode).

Can anyone shed some light here?

+4
source share
6 answers

It turns out that this was actually the result of upgrading to Windows Vista. VS was not "Run as administrator", because of which he did not have enough rights to join other processes for debugging. As a result, debugging stopped immediately after it started. Changing the VS task to run as administrator resolved this issue.

+10
source

I experienced a peculiar behavior. The reason was the existence of several <system.web> sections (which is allowed by the web.config scheme). The Visual Studio debugger (versions 2008 and 2010 have been tested) only looks at the first column. Therefore, if the tag <compilation debug="true"> not in the first, it considers that there is no .debug compilation setting, and genryly tries to add <compilation debug="true"> to the first <system.web> . In some cases, VS2008 just works quietly in this case. For example, look here: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=510354#details "

+2
source

Have you recently installed anything else on the server / workstation?

We have a third-party application that does not allow debugging, w3wp.exe crashes immediately after a debugging attempt.

0
source

I came across something similar when I put some code in a constructor that crashed. The exact problems with which Debug will be disabled immediately after starting the application.

In short, if this is the case, make sure that you do not configure the class constructor to start when the web site that crashes starts ...

0
source

Quick update of Windows 7: I had to add "localhost" to the list of trusted sites to fix this problem ... go figure.

0
source

Just a workaround for those (like me) for whom the above solutions do not work: after launching the application you want to debug, go to Debug → Attach to Process and attach it to the process you want to debug. It works on my car.

0
source

All Articles