A Little Debugging Tip

I really like the fact that VS 2005 offers its own little private web server to debug your apps with.  I really do not like that I can not figure out how to add virtual directories to it.  Why you may ask would I need to do that?  Well despite the many instances when you do this in real life, for instance I am posting a private application on a customer's site today.  But more often than not you will be using a thirda party control, like Infragistics or the FreeTextBox.

Many times these controls rely on virtual directories with support files, such as images and javascript files to operate correctly.  I love the FreeTextBox and use it on almost all sites, as I do Infragistics controls.

When I first began developing ASP.NET 2.0 application I quickly hit this wall where these controls would not work.  After a couple of days of posting to the supposidly 72 response time newsgroups with my MSDN subscription with NO REPLY, I figured a way around.

You need to change which web server you are going to use, and change it back to your local instance of IIS 5.1 or IIS 6.0 (whatever OS you are running will depend).  You can do this by opening up your properties dialog for your web project (yes I said web project, more on that later) and go to the 'Start Options' section. 

Here you will see what the settings are for your web site.  You do not need to worry about the start action section.  This you set by telling the project what page to start with, so skip that.  The second section is 'Server'.  Click the 'Use Customer Server' radio button.  Now the 'Base URL' text box is active.  Type in the direct address to your site, http://localhost/my20website, for example.  You need to remeber the http:// part or you will get a nasty dialog telling you your address is invalid.

Click the OK button and presto chango you can now click F5 to your hearts content and all your problems will be solved.

Share This Article With Your Friends!