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 on Friday, November 03, 2006 10:31 AM by jatwood

Comments

# re: Web Site Projects vs. Web Application Projects

Thank you so much for saying what most of us have been saying for quite some time. Believe it or not there is still some resistence to using the Web Application Projects over the standard VS2005 WebSite.
Wednesday, November 15, 2006 10:50 PM by Kevin Castle

# re: Web Site Projects vs. Web Application Projects

I've with Kevin. Web App Projects are the only way to go.
Friday, November 17, 2006 8:07 AM by Dave Donaldson

# re: Web Site Projects vs. Web Application Projects

well, although a WAP seems the right thing to do instinctively, there are some cases where WSPs give a better TCO. Remember, WAPs involve more SCM (Configuration Management) and Deployment work. For cheap and easy websites which are less component oriented, sometimes just an xcopy is easier to do.
Thursday, November 30, 2006 5:33 PM by Rahul

# re: Web Site Projects vs. Web Application Projects

We have just completed the setup process for Team System and have been working on a project with serveral programers and designers located (geographically) in different places. We have discovered several issues with WAP and Team System. The first is that you must "Check out for editing" the DLL and PDB before you can compile the project, even though we are working on Local Host. This is a BIG issue since we all need to compile the WAP in order to see if what we have programmed is working. Only 1 developer can check out the DLL and PDB at a time, which is killing us. Another issue is that we must add itmes to source control that we would normally not do (like images) because we want and need to update the production server from within Team System and if these items are not included in source control then they will not end up in Production, causing the site to break. We are now testing the Web Site model and have found that many of these issues are overcome, so far the Web Site model seems to be the way to go.
Friday, December 29, 2006 8:31 AM by Michael

# re: Web Site Projects vs. Web Application Projects

I agree with your statement Michael.

After suffering for so long with VS2003 WAP that really doesn't work with SourceSafe and many developpers, i am ready to use VS2005 WebSite Project.

Hey! After all, isn't it what IIS does, work files included in a folder or subfolder ???

Tuesday, January 09, 2007 8:23 PM by Yvan

# re: Web Site Projects vs. Web Application Projects

As a general rule, you shouldn't be checking in the binaries that are built from your project. Remove the assembly and symbol file (dll and PDB), and the web app problems will go away.
Wednesday, January 10, 2007 4:35 PM by Sean

# re: Web Site Projects vs. Web Application Projects

I have worked with WSP and WAP. I would not 100% say that WAP is the ONLY way to go. WSP is nice because you can release content only pages with out having to BUILD. It is easier for developers to make quick changes when developing with out having to BUILD to see their changes.
WAP give you better security because you code is locked away inside a DLL.
Monday, February 12, 2007 12:08 PM by sean lan

# [PLEFDS] Inline, beside, behind, Web Site Project, Web Application Project, y bla bla bla...

De ahora en adelante [PLEFDS = para leer el fin de semana]. Digamos que hay dos maneras de tener el código
Thursday, February 21, 2008 10:29 AM by SergioTarrillo's RichWeblog

# Inline, beside, behind, Web Site Project, Web Application Project, y bla bla bla...

Todo acerca de Inline, beside, behind, Web Site Project y Web Application Project. De ahora en adelante
Sunday, March 23, 2008 1:00 PM by .net y algo mas