views:

29

answers:

3

I have an puzzling problem. I have a new ASP.NET web application in VS2005 that runs fairly well, but I am having a problem and would like to set a break point to see what is going on. I have compiled the project in Debug mode. I have debug=true set in the web.config. But it appears that the IDE is not attaching to the process at all. Have I overlooked something? I am using the development server and not IIS. This has never been a problem in the past, but is this time.

Have I overlooked anything? Thanks for any help.

Rob

A: 

Sorry if I am stating the obvious, but you need to Start Debugging <F5> rather than just running the executable after compiling. Are you doing this?

RedFilter
Obvious is good! However, I am starting the debugging. I have used F5 and Debug/Start Debugging both. It won't attach.
Rob
A: 

If you don't hit the breakpoint, you are either not debugging (F5) or your code isn't reached at all. If you want to know which of the two is happening you can throw an exception right at the code where your breakpoint is. If your application is failing at the exception, you know you are not running it with the debugger. If it doesn't fail at the exception you are simply not reaching that piece of code and you will have to look harder for which code you are actually running.

throw new Exception("if I see this exception, I am not running the debugger");

Or maybe you are running two instances of the development server. I've had that sometimes. Look in the Windows system tray for the icon. If you see two (or more) you can right click to stop them and restart debugging.

alt text

Jan
The application threw the exception and so is getting to the code. I had earlier stopped all the development servers. It didn't help.
Rob
+1  A: 

I had this issue a while back with VS2005. I don't remember where I got the following instructions from (copied them to a file which I'm now copying to you) but doing the following steps worked for me. It has something to do with IE8 attaching itself to multiple processes and messing up the debugger. Word of warning, this has you editing the registry, so use at your own risk / take all your normal precautions, etc.

  1. Open RegEdit
  2. Go to HKEY_LOCALMACHINE -> SOFTWARE -> Microsoft -> Internet Explorer -> Main
  3. Add a dword under this key called TabProcGrowth
  4. Set TabProcGrowth to 0

    If you run into the same problem on Vista or newer, you will also need to turn off protected mode.

Please note also that I was/am running XP at the time, so I did not have to use the "Vista or newer" clause there. No idea if that has any adverse effects either.

JN Web
That did it! Thank you very very much!
Rob
@Rob No problem! I remember tearing my hair out over this and having to write annoying forced exception throws to debug for about a week before I found it. Good ol' IE.
JN Web