Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Currently, I am reading Pro ASP.NET 4 in C# and in it, two ways of creating a web application are described:

  • Website
  • Web Application Project

In which scenarios should I choose the former over the latter, and vice versa?

share|improve this question

closed as too broad by gnat, Snowman, enderland, Ixrec, GlenH7 Mar 13 at 16:13

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

3  
This question has been asked ad nauseum over on stackoverflow.com. Here's a link to a good one: stackoverflow.com/questions/398037/… ... feel free to type web site vs application into the search sometime. – Joel Etherton Aug 20 '11 at 18:02
up vote 7 down vote accepted

Microsoft made a table listing the differences between the two models, and when to use one instead of the other, check out http://msdn.microsoft.com/en-us/library/aa730880%28VS.80%29.aspx#wapp_topic5 This is exactly what you are looking for, and the explanations are very easy to understand.

In short: "web application projects" may be formed of multiple Visual Studio projects and are also to be used for websites designed around the MVC pattern. Whereas a "Web site" project is just that, one "web" project and all files must be contained inside (you may however link to other assemblies); it is better suited for old-school ASP.Net websites.

That article I linked to above gives a lot more information, check it out!

share|improve this answer
3  
Websites aren't necesarily just one project. We have multiple ASP.NET Websites that haven't been converted to Web Applications yet, and they all share some common assemblies. – Davy8 Aug 20 '11 at 19:08
    
I edited my answer, what I meant was that you have one "web" project but that does not mean it cannot depend on other project references, or other assemblies. – Jalayn Aug 20 '11 at 19:39

There is a HUGE list of reasons to use one over the other, but usually when I'm making a decision I base it on a few parameters. For instance, do you want your code files to be out in the open (well, still behind server security) or would you rather they are compiled into code libraries?

share|improve this answer

In ASP.NET website, if we create any class files/functions those will be placed in ASP.NET folder and it's compiled into many DLLs at runtime.

In ASP.NET Web Application, If we create any class files/functions those will be placed anywhere in the applications folder structure and it is precomplied into one single DLL.

You need more help, go to http://www.keenesystems.com/Expertise/ASPNetWebApplications.aspx

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.