<

Go Premium for a chance to win a PS4. Enter to Win

x

Microsoft .NET Web Programming:  Web Sites versus Web Applications

Published on
9,759 Points
3,459 Views
3 Endorsements
Last Modified:
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x

The Web Site is a file/folder based Project structure.  It is designed such that pages are not compiled until they are requested ("on demand").  The advantages to the Web Site are:
      1) It is designed to accommodate non-.NET Applications
      2) Deployment is as simple as copying files to the target server
      3) Any portion of the Web Site can be updated without requiring recompilation of the entire Site.

The Web Application is a .dll-based Project structure.  ASP.NET pages and supporting files are compiled into assemblies that are then deployed to the target server.  Advantages of the Web Application are:
      1) Precompiled files do not expose code to an attacker
      2) Precompiled files run faster because they are binary data (the Microsoft Intermediate Language, or MSIL) executed by the CLR (Common Language Runtime)
      3) References, assemblies, and other project dependencies are built in to the compiled site and automatically managed.  They do not need to be manually deployed and/or registered in the Global Assembly Cache:  deployment does this for you

If you are planning on using automated build and deployment, such as the Team Foundation Server Team Build engine, you will need to have your code in the form of a Web Application.  If you have a Web Site, it will not properly compile as a Web Application would.  However, all is not lost:  it is possible to work around the issue by adding a Web Deployment Project to your Solution and then:
  a) configuring the Web Deployment Project to precompile your code; and
  b) configuring your Team Build definition to use the Web Deployment Project as its source for compilation.

There is an excellent Microsoft webcast by Zain Naboulsi going into detail about the differences (and how to convert a Web Site to a Web Application) here:

https://msevents.microsoft.com/cui/WebCastEventDetails.aspx?culture=en-US&EventID=1032380764&CountryCode=US
3
Comment
1 Comment
 
LVL 4

Author Comment

by:PyanfarChanur
Mark, thanks very much for your support!  I do this kind of stuff in-house all the time...as I realized I needed to do more with my ExpertsExchange account, it seemed natural to want to start publishing some of this stuff.

Thanks again - I look forward to adding the little bits and pieces of information I come across from time to time.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Join & Write a Comment

Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month12 days, 23 hours left to enroll

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month