הבלוג של מאור - Maor's blog

טכנולוגיה ושאר ירקות

על הבלוג

RSS

 

מהבלוג שלי ב msdn

maor's blog

↑ Grab this Headline Animator

התחבר אלי

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

Blog Roll

My Favorite Technologies

Links

Team System Forums

RSS

Blog Pages

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.

תוכן התגובה

kolbis כתב/ה:

Thanks...I needed it.

# June 3, 2007 11:43 AM

John J. Adams כתב/ה:

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 ?

# October 11, 2007 8:24 PM

SergioTarrillo's RichWeblog כתב/ה:

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

# February 21, 2008 8:29 PM

Visual Studio Team System » Blog Archive » ???????????? ?????? part 1. כתב/ה:

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

# March 3, 2008 10:09 AM

.net y algo mas כתב/ה:

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

# March 23, 2008 10:00 PM

Maor David כתב/ה:

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.

# May 17, 2008 4:54 PM

Heidi כתב/ה:

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

Regards.

Heidi

# June 9, 2008 11:48 AM

Maor David-Pur כתב/ה:

Hi Heidi

The web site - cause it's compilation model.

# June 9, 2008 5:19 PM

Micah כתב/ה:

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?

# June 21, 2008 12:20 AM

Heidi כתב/ה:

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

Regards,

Heidi

# August 1, 2008 8:05 AM

wan accelerators כתב/ה:

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

# January 10, 2009 11:36 AM

ASP.NET Website vs Web Application project | TechBubbles כתב/ה:

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

# February 14, 2009 3:58 AM
שלח תגובה

(שדה חובה)  

(שדה חובה)  

(אופציונלי)

(שדה חובה) 

Please add 2 and 1 and type the answer here:


Enter the numbers above: