DCSIMG
ASP.NET 2.0 - Web Site vs Web Application project - Maor's Blog

ASP.NET 2.0 - Web Site vs Web Application project

This post was migrated. You can read it at http://blog.maordavid.com/2007/06/aspnet-20-web-site-vs-web-application-project/ 

A common question by asp.net developers is what project model should I use for asp.net application? Web Site project (which introduced with VS 2005) or Web Application project (which delivered as add-in for VS 2005 and built-in within VS 2005 SP1)?

There is no thumb rule. Every project model has it's own advantages (and diss-advantages off course...). I hope this post will help you to understand better the differences between 2 of them.

Web Application project model

  • Provides the same Web project semantics as Visual Studio .NET 2003 Web projects.
  • Has a project file (structure based on project files).
  • Build model - all code in the project is compiled into a single assembly.
  • Supports both IIS and the built-in ASP.NET Development Server.
  • Supports all the features of Visual Studio 2005 (refactoring, generics, etc.) and of ASP.NET 2.0 (master pages, membership and login, site navigation, themes, etc).
  • Using FrontPage Server Extensions (FPSE) are no longer a requirement.

Web Site project model

  • No project file (Based on file system).
  • New compilation model.  (Read here or here for more details) and ...
  • Dynamic compilation and working on pages without building entire site on each page view.
  • Supports both IIS and the built-in ASP.NET Development Server.
  • Each page has it's own assembly.
  • Different code model.  (Read here for more details)

Ok, all is great, but you want to create your web site now. Which model should you use?

  • You need to migrate large Visual Studio .NET 2003 applications to VS 2005? use the Web Application project.
  • You want to open and edit any directory as a Web project without creating a project file? use Web Site project.
  • You need to add pre-build and post-build steps during compilation? use Web Application project.
  • You need to build a Web application using multiple Web projects? use Web Application project.
  • You want to generate one assembly for each page? use Web Site project
  • You prefer dynamic compilation and working on pages without building entire site on each page view? use Web Site project
  • You prefer single-page code model to code-behind model? use Web Site project.
Published 03 June 2007 12:04 AM by Maor David-Pur

Comments

# kolbis said on 03 June, 2007 11:43 AM

Thanks...I needed it.

# John J. Adams said on 11 October, 2007 08:24 PM

Thanks for this post. I was doing fine using the web site model but I wanted to put my source code into Visual Sourcesafe 2005 (Version 8.x) which prevented me from adding the web site because of the Front Page Server Extension files. For years, I have been using the WinDiff utility to compare ProductionWeb folders versus DevelopmentWeb folders and learning to visually ignore the inequalities in the _vti files.

So with the goal toward having all my web source under SourceSafe, I began an experiment of cloning/migrating my "web site" code into the "web application project" model - mostly to eliminate the requirement for FrontPage Server Extensions.

While I've achieved the SourceSafe objective, I have run into lots of confusion on the web application project way of doing things.

As I understand the web appl proj thing, all development is local and when I am ready I can copy a single DLL for my project to a remote IIS web server and hence FPSE will not be needed.

How do the experts handle minor changes then in their production web applications? If a minor change were required to some .ASPX markup, for example, would you have to FTP the new .ASPX file to the remote IIS server?

With the web site model, I could just edit the single file in place.

I guess a corallary question is could a web "site" model be placed under control of Visual Source Safe 2005 ?

# SergioTarrillo's RichWeblog said on 21 February, 2008 08:29 PM

De ahora en adelante [PLEFDS = para leer el fin de semana]. Digamos que hay dos maneras de tener el código

# Visual Studio Team System » Blog Archive » ???????????? ?????? part 1. said on 03 March, 2008 10:09 AM

Pingback from  Visual Studio Team System  » Blog Archive   » ???????????? ?????? part 1.

# .net y algo mas said on 23 March, 2008 10:00 PM

Todo acerca de Inline, beside, behind, Web Site Project y Web Application Project. De ahora en adelante

# Maor David said on 17 May, 2008 04:54 PM

Last week it was exactly one year since I started blogging, so this is my blog first birthday!! Come and read about the blog's statistics, top posts and more.

# Heidi said on 09 June, 2008 11:48 AM

If you need the best performance in an application delivered to many users (7000 concurrent users), which project type is the best?

Regards.

Heidi

# Maor David-Pur said on 09 June, 2008 05:19 PM

Hi Heidi

The web site - cause it's compilation model.

# Micah said on 21 June, 2008 12:20 AM

I've searched the internet extensively looking for ANY information about a "Web application using multiple Web projects".  The only information that can be found is in articles just like this one that say to use a Web Application project.  What I want to know is this:

I have "web application" that consists of the web sites:  www, secure, and members.  The user browsers to a url at our domain and is directed to the www site where a login form exists on the home page.  The login form posts to the secure site where several checks are performed to verify the user is allowed to continue.  If the checks are passed the user is redirected to the members site where they can perform all kinds of tasks.  In VS 2003, we had 3 separate solutions, one for each of the sites.  The sites have common references to other assemblies.  So when I rebuild the members site, I also have to rebuild the www and secure sites just to make sure the referenced assemblies are all up to date.  I am now trying to create a solution that contains all three of the Web Application Projects as well as the referenced assemblies in VS 2008.  I am trying to find some information about how to make this work with the ASP.NET Development Server that is part of VS 2008 (if possible), recommendations about how to lay everything out in source control, and recommendations on setting up Team Project(s) in Team System for this.  

Any recommendations on where to find this kind of info?

# Heidi said on 01 August, 2008 08:05 AM

Why is it's compilation model better than the compilation being done in a Web Application?

Regards,

Heidi

# wan accelerators said on 10 January, 2009 11:36 AM

October 27- 29, 2009— Los Angeles Convention Center, Los Angeles, CA view more… Corporate News TMC Offers Preliminary Look at ITExpo East 2009 Program 16th Annual MVP Quality Award Open for Nominations 16th Annual MVP Quality Award Open for Nominations

# ASP.NET Website vs Web Application project | TechBubbles said on 14 February, 2009 03:58 AM

Pingback from  ASP.NET Website vs Web Application project | TechBubbles

# Ran Wahle's blog said on 23 February, 2011 03:32 PM

At the customer I work for there are several applications written as a web site instead of Asp.Net web application project In this post I’m going to demonstrate, in a few steps, hoe to successfully convert VS-Web Site to VS-Web Application Project.

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above:

Search

Go

This Blog

News

    RSS

     

    Connect with Me

    Maor's Facebook profile  Follow Maor on Twitter  Maor's profile on Linkedin  Maor in FriendFeed 
           

Syndication