VS2005 IIS Binding Can be removed

In Visual Studio 2005 SP1, the new “web-application” project type was introduced. This project type allowed us to have a csproj for the website project and suddenly we were in control of the content of a project and integrating it into an automated build process became simple.

However the best reason for wanting to ditch the old school website project in favour of the web-application project was not needing to bind the project to an IIS website. With an ASP.NET website project, the website project itself needs to be bound to a corresponding website under IIS, which is a real PITA, particularly when you don’t have the necessary environment set up.

So with VS2005 SP1 and web-application projects, all these problems are a thing of the past, right? Wrong, it seems.

I was opening one of our projects written by a contractor and it looks like he’s somehow managed to re-introduce project-website binding in a web-application project. Don’t know how, but whenever the project is opened, if it couldn’t connect to the project’s website running on localhost, it would throw a COM Interop Exception.

Simple solution – remove IIS website binding. It’s unnecessary and provides no benefit if your deployment process is handled outside Visual Studio. Open up the .csproj file, and remove the <ProjectExtensions> element and its children.

Problem solved.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>