Who has not encounterd this problem: you’re just doing some debugging on your favorite SharePoint application and all over sudden – bam! The application pool gets recycled.
Well, the problem is the timeout associated with each application pool. When IIS detects that an application pool is not responding anymore IIS just assumes something terrible happend and recycles the application pool. But all that really happend is some plain-old-debugging.
In order to circumvent this problem you have to disable the pinging of application pools by IIS. Just open up the advanced settings of the IIS application pool and set pinging to false.