Web Application Projects vs Web Site Projects

Published on Monday, August 22, 2011

Since Visual Studio 2008, We can see there are two different web projects: ASP.NET Web Application and ASP.NET Web Site. Actually in Visual Studio 2005, Microsoft tried to remove the web application and replaced it with web site project, but there were many feedbacks indicated programmers need web application project. Later Microsoft released the package for web application project which was for Visual Studio 2005, at that time, some  of earlier VS users needed to install the package separately.

webvsprj00

Web Application project:

1: There is a project file (.csproj or .vbproj) so that you can just double click it to open the project in Visual Studio;

2: You can easily exclude any file using mouse click without file name changed;

3: You must explicitly compile the source code before deployment, By default, compilation of code files (excluding .aspx and .ascx files) produces a single assembly.

4: You can not update individual ASP.NET Web pages (.aspx files) without having to recompile the entire Web site.

5: You can establish project dependencies between multiple web projects;

6: MVC application must use Web Application project;

Website project:

1: No project file (.csproj or .vbproj). You have to browse to the folder to open the project using Visual Studio;

2: All files within the site’s directory are included in the site. If you want to exclude a file, you have to rename the file with an extension .exclude;

3: You do not have to explicitly compile the project in order to deploy it. But you can still precompile the site. When you compile, the site will be generated by separate assemblies for each page or each control, or one or more assemblies per folder;

4: You are able to update individual ASP.NET Web pages (.aspx files) without having to recompile the entire Web site.

5: The site can easily be deployed or shared by copying the folder simply without precompile, but the source code will be copied to remote server;

About more different detail information, Please read MSDN Web Application Projects versus Web Site Projects and stackoverflow ASP.NET: Web Site or Web Application?