Branislav Abadjimarinov's technical blog

Visual Studio debugging and IIS 7 Application pools problem

Posted in Visual Studio, Debugging, IIS by Branislav Abadjimarinov on 11/12/2009 6:36:00 AM - CST

I had a strange problem debugging asp.net websites hosted on IIS 7. I attached the Visual Studio debugger to the working process of the IIS (in my case w3wp.exe) and started debugging. After a couple of minutes I got disconnected. This behavior reproduced every time.
After checking the IIS 7 Application pool settings I found out that this is an intended behavior. The IIS pings the working process in a configured time intervals (2 minutes by default) and if the process is hanging (not responding)  it restarts the process. When you attach a debugger to the process and you stop at a breakpoint for more than 2 minutes the process will not respond to the ping and it will be killed in the middle of your debugging session. To prevent this simply disable ping in IIS Application Pool settings or extend the ping time intervals.If you do this in development environment don't forget to switch it to true on production servers, because it may be a security issue.


To switch it off:
1. Open the IIS Manager (Run->inetmgr).
2. Go to the "Application Pools" and select your site's pool.
3.In the right pane click Advanced Settings.
4.Find "Ping Enabled" in the list of settings and choose "False" for its value


How to disable IIS 7 Application pool ping

Comments

Trackback  on 11/21/2009 7:36:24 PM - CST
Gravatar
Posted by Emanuele Ciriachi on 12/2/2009 10:10:22 AM - CST
Thanks, that saved me and my colleagues a lot of hassle!
Gravatar
Posted by mat roberts on 2/2/2011 4:37:38 AM - CST
Cheers, that worked great
Gravatar
Posted by Mp on 4/5/2012 10:20:33 AM - CST
Thanks a lot, this helped me so much.

Add Comment

Please enter your name. Please enter a valid email. Please enter a valid website.
Please supply a comment.
© Copyright 2017 Powered by AtomSite 1.3.0.0