views:

139

answers:

4

I'm trying to debug an ASP.NET web application in this environment:

  • Windows Server Standard 2008 SP2 x64
  • Single-core CPU
  • 4GB RAM
  • Visual Studio 2008 with Remote Debugger SP1
  • .NET 3.5 Web Application running in IIS in 64-bit mode

The code I am trying to debug is a simple event handler with some basic sequential code.
What I observe is that breakpoints get randomly ignored and VS often exits debug mode when I try to step through the code. The code is compiled in debug mode.

EventViewer shows no warning or error messages that would relate to this. I am certain that this is not caused by IIS app pool recycle/reset.

I've tried all the usual steps: iisreset, reboot VM, rebuild solution, reinstall Visual Studio.

Any ideas?

A: 

Maybe your IIS App Pool is recycling for some reason once in a while. This kills the IIS worker process and therefore unhooks the debugger.

You can check if this happening in the Eventlog. Also check you application pool settings in IIS Manager.

Rody van Sambeek
EventViewer shows no warning or error messages that would relate to this. I am certain that this is not caused by IIS app pool recycle/reset.
Arnold Zokas
A: 

Got the same problem with randomly missed breakpoints and debug mode resuming/stopping when stepping through, on a WPF application though. This fix solved it:

http://code.msdn.microsoft.com/KB957912

Julien Lebosquain
A: 

Could not find a solution.

Worked around this behaviour by using a combination of Debug.Print() and Sysnternals DebugView

Hope this helps.

Arnold Zokas
+1  A: 

I had the same problem with a Windows Form application, and I applied the same hotfix as Julien did. (http://code.msdn.microsoft.com/KB957912). I haven't had the problem since.

John J