Monday, February 12, 2007

Today while working with ASP.NET I have received a "Internet Explorer cannot display the webpage" error when I tried to get to one of the pages. Other pages worked well. My first thought was to use a debugger of course and so I did only to be presented with a following message:

---------------------------
Microsoft Visual Studio
---------------------------
Unable to start debugging on the web server. Could not start ASP.NET or ATL Server debugging.

Verify that ASP.NET or ATL Server is correctly installed on the server.
---------------------------
OK Help
---------------------------

Strange...
I haven't changed anything in my computer's software configuration for a while now. Why would debugging stop to work when it worked well just few minutes ago?
It had to be somehow connected with that one page I thought so to get this solved I needed a working debugger. First I have killed the w3wp.exe process - didn't help. Next I have restarted a website in IIS - didn't help. Finally I went and restarted the World Wide Web Publishing Service and it did the trick. I had a working debugger so I could work on the main problem.
As it came out, I have made a simple mistake and caused an infinite recursion which caused a StacOverflowException to be thrown. After I have found the problem and corrected it my problem with a debugger came back! Aha! So if there is a StackOverflowException, something gets broken in the IIS!
Few tests confirmed it. I have observed that if a StackOverflowException is thrown while navigating to a page (without debugger attached) - nothing happens. You can do it "safely". If however, you are debugging and StacOverflowException is thrown inside your debugger, it usually takes only one such exception to kill IIS.
How important is this problem? It depends of course, but imagine what would happen if you have debugged a server running a couple of sites and all went down for no apparent reason while you have debugged your code. Fortunately usually it is not possible to run a remote debugger on a shared hosting environment :-)

Monday, February 12, 2007 9:55:11 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [1]  |