Continuing from my previous post on common causes for memory leaks, remote debugging is another ASP.NET feature that has the potentiality to either delight (uhm... am I exaggerating here...? ) a web developer or drive him completely crazy I remember 8-9 years ago, when I was a young technology passionate learning the basics of web development (HTML, CSS, ASP etc...), on my desk I just had a couple of programming books for beginners, my dial-up modem to download some online manuals and my copy of Office 97 for students. My editors at that time were FrontPage 97 and Notepad... so all I could do to debug my web pages were to use lots of Response.Write() to inspect variable values, and lot of brain work to try to understand where things were going wrong...
With ASP.NET and Visual Studio .NET in these days developers still have to do lot of brain work, but for sure the tools now help a lot with debugging web applications... but what happens if the debugger has tantrums? Here is a list of the common debugger problems I saw so far in my experience with Microsoft Support; this is not at all a comprehensive list, you can find out more doing some research in MSDN, Knowledge Base or your favorite search engine.
Make sure your application is configured to be debugged; to do this check that your web.config file contains the instruction debug="true". NOTE: please remember to set this to debug="false" when you deploy your application in production! See this and this.
You may need to think about the order of installation between Visual Studio and IIS; If you install IIS after Visual Studio you will get this error. In this case you need to register the ASP.NET mappings in IIS with “aspnet_regiis.exe –i” from the .NET Framework installation folder (choose the version you want to restore).
Quite self explanatory...
To be able to attach to the ASP.NET worker process your account must be part of the "Debugger users" group and be an Administrator of the remote machine; as an alternative you can configure your ASP.NET worker process to run under the same account you'll use to logon on on your development machine.
In the work group environment, you need to make sure that you have the same named user account on both machines with the same password, otherwise DCOM will fail to authenticate you.
There is one more consideration: on XP Pro, because of the default security setting for "sharing and security model for local accounts", remote debugging is not allowed by default. Here are the steps to change this setting:
Make sure that your user accounts on each machine has password. In some cases, without actual password it doesn’t work. This change should be applied on both machines for remote debugging now you should be able to remotely debug your application.
However, there is security concern about this: because you changed default settings of the security model, it can expose:
By default any kind of connection from the remote machine to your machine was guaranteed as "Guest", but after this change new connections could be authenticated with your local user account. So, like in the case of debugging, if you are sharing out a folder or DCOM object there is a possibility that any matched user (same user name and same password) on other machines could access your shared objects.
I strongly recommend that, if you want to use this work-around, you make sure that all user accounts have strong passwords, or should setup network-Island for the debugging machines to prevent any malicious attack.
Update (30/03/2007) I'm not sure when this was published, but here is an interesting list of common debugger errors and solutions
Cheers Carlo
Good Blog.
The .webinfo file in the project folder had the loopback address as 127.0.0.1, changed it to localhost.
It did the trick!