November 2006 - Posts

Web Site Projects vs. Web Application Projects

If you’re creating new web apps in ASP.NET 2.0 that you intend to store in Team Foundation Server Source Control, I strongly recommend avoiding Web Site projects in favor of the new Web Application projects. Here’s how you create each one in Visual Studio 2005:

Web Site Project:

==>

Web Application project:

==>

What’s the difference between the two? There's a detailed comparison here, but to summarize:

  • Web Application projects have a physical project file and resemble the “classic” Visual Studio 2003 web project model.
  • Web Site projects have no project file (this is incredibly, unbelievably annoying in a lot of scenarios) and are solely based on what’s in the filesystem (ditto).

Web Application projects will be a standard feature of Visual Studio 2005 Service Pack 1, but you can install them today as an add-in from Microsoft.

I absolutely would not create a Web Site project for anything other than temporary one-off demos. Web Site web projects are particularly painful in Team System due to the lack of a physical file that contains project information and metadata. For example, it's impossible to check in code analysis rules on Web Site projects, because the code analysis rules are stored entirely on the client!

Bottom line, if it’s a project you plan to carry forward over time, make it a Web Application Project to keep your sanity.

For more information on Web Application Projects, try:

posted by jatwood with 9 Comments