How to develop an ASP.NET web project without IIS binding – level 200

If you’ve every shared an ASP.NET project or worked on one on multiple computer, you know what a pain it is to ensure that all computers have the same IIS virtual directory configured.  If you don’t, the project won’t open.


For ASP.NET 1.1, it’s easier to use a class library project instead of a web project.  You lose a bit of designer support, but you gain project portability.  If you are like me, you don’t use the designer at all, and it’s all gain and no loss.


The trick is to delete the *.csproj.webinfo file,  take your web project and open the .csproj file in notepad.  Then find the following at the top of the file:


<VisualStudioProject>
    <CSHARP
        ProjectType = “Web”
        ProductVersion = “7.10.3077”
        SchemaVersion = “2.0”
        ProjectGuid = “{09E1A7E2-B51D-42EA-A2BE-4A5991BDF2A7}”
    >. . . . . . .


And just change “Web” to “Local”


<VisualStudioProject>
    <CSHARP
        ProjectType = “Local”
        ProductVersion = “7.10.3077”
        SchemaVersion = “2.0”
        ProjectGuid = “{09E1A7E2-B51D-42EA-A2BE-4A5991BDF2A7}”
    >. . . . . <snip/>


Literally, that’s all it takes.  Now your poject opens as a class library, and you just set up IIS to wherever the project is.  You can debug just like before, and you can use pages and user controls just like before.


One note:  Change the project type back to “Web” before upgrading to .Net 2.0 or the project conversion wizard won’t properly create a website.