Determine when to use the Web Site model vs. a Web Application Project

There was a post already about them, but I failed on about every question on the exam where they were involved. So this one will be a quick repost of the old facts.

A Web Application Project is very similar to a traditional desktop project. You can control references in a specialized folder, have an AssemblyInfo.cs and a project file for controlling which files belong to the project explicitly (the Web Site model does this implicitly: what’s in the folder is in the project). Also, it provides backward-compatibility, since it was the default project type for web pages in VS 2003.

You’d like to use Web Application Projects when:

  • You are migrating from VS 2003.
  • Need to control the names of the output assemblies.
  • Need stand-alone assemblies to reference page and user control classes.
  • Need a Web Application using multiple Web Projects.
  • Need to add custom steps during compilation.

And in the following scenarios, you’d use the Web Site model:

Continue reading


Configure Projects, Solutions and Reference Assemblies

Configure Projects

There are four project types for creating a web application in Visual Studio, which you should be familiar with for this exam. Namely: ASP.NET Web Site, Empty Web Site, ASP.NET Web Service, and ASP.NET Web Application. We will cover ASP.NET Web Site, and ASP.NET Web Application.

ASP.NET Web Site:

This project type is file-based, and there is no project file included. So every file- whatever its extension would be- in a given folder is the part of your project. This is the default web site project type in Visual Studio (simply click on the New Web Site button on the menu (represented as an Earth globe).

This template generates a web.config file with some initial entries, and a Default.aspx page with the given code-behind file for you. Also an App_Data folder will be included to help you begin your work. The above mentioned Empty Web Site project is exactly the same as this project type, the difference is that you won’t get any content generated at startup.
Continue reading