简体   繁体   中英

ASP.NET with VS 2010: Web Site or Web Application?

When I start a new ASP.NET project in Visual Studio 2010, I can either create a new ASP.NET Web Site or an ASP.NET Web Application.

What's the difference between these two project types? Why would I choose one over the other?

Please note : this question is an exact duplicate of this one , but I'm asking specifically about Visual Studio 2010 (there are no answers targeted at VS 2010 in the original question). So are the answers of the other question still valid or are there any changes with VS2010 which results in different answers?

I just want to give an example that website means its a site by which we can get some information. they will be a collection of websites in a Web Application. Example take any company site. And coming to web Application the best example is Gmail. which is an application . which we use. This is the general difference between these two. Even it may also contain a collection of websites. But depending on the Requirement.

I know this question is a bit old, but just in case someone finds it.. I believe that if you want to use Web.config Transformations (useful if you want to have different setting's for development and release) then you need to be using a web application.

Technically this is probably a result of the same differences as in 2008 between a web site project or a web application project, but being that it's a new feature in vs 2010 (at least built in, i think you can get it in vs 2008 also ) it's at least one new difference from vs 2008 to vs 2010 to consider when choosing which way to go.

I would recommend website only for a very simple/small application. Build times are higher, you cannot use nuget, there are no namespaces (although aspx and ascx class names can be pretty cool), no conditional compilation symbols, no immediate code tests (since there's no a single .dll to be referenced), etc.

In more complex scenarios the way to go is web application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM