When living in the InfoPath and SharePoint world I sometimes don't really get to know how to use some tools that great until I get a stray project that forces me to do things that I normally wouldn't do on a day to day basis. Recently I've had two projects like that and fortunately for me I've learned a bunch of new stuff that probably most developers learned years ago when the tools were first released. This post is about me finally figuring out how to switch back from Visual Studio 2005 "IIS Web Server" debug mode to "Visual Studio Development Server" mode. In Visual Studio 2005 web projects have this properties tab called "Web" and on it you can specify either to run debug from "Visual Studio Development Server" or "IIS Web server" and both of these options have their pros and cons but I'm not going to get into that because that is another blog post if you ask me. Below is an image of the properties tab Web.

Usually when I'm starting out on a new project I've always found myself always using the "Visual Studio Development Server" for debugging but once I start publishing my sites to IIS then I usually switch to "IIS Web Server" but one of the biggest problems that I've had was not being able to switch back to "Visual Studio Development Server" mode and successfully publish my code to the desired IIS website. Whenever I would switch back and try to publish my code to the IIS website I would get this error.

This error has haunted me for about 2 or 3 projects and I finally got tired of it and started to do some searching to find a fix but was unable to. So I started messing around with the settings on the Web properties tab and noticed that the "Project Url" and "Override application root URL" textboxes were getting pre-populated and in most cases I was changing the values to point to the IIS website I published to.

Once I noticed that these values were not being cleared out when I would click on the "Use Visual Studio Development Server" radio button then I decided to clear them out manually and then try publishing again. When I tried the publishing everything worked and the error went away. So when you switch back and wan't to use the publish feature but you can't because of the error message, just make sure everything is cleared out and looks like this image below.

I'm sure everyone in the world knows this but since this was my first I figured I would blog it. Hope everybody had a great weekend.
Cheers