Hi All,
Could any one help me to understand the difference between the WebSite and Web Application ?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
TulasiPosted Oct 14, 2011, 3:12 AM
Web Site
1. We can code one page in C# and one page in vb.net (Multiple programming languages allowed).
2. We cannot call (access) public functions from one page to other page.
3. Utility classes / functions must be placed in a special ASP.NET folder (the App_Code folder)
4. Web Sites do not have a .csproj/.vbproj file that manages the project (the folder that contains the site becomes the project root).
5. In the Web Site project, each file that you exclude is renamed with an exclude
keyword in the filename.
6. Explicit namespaces are not added to pages, controls, and classes by default, but you can add them manually.
Web Application
1. Only one programming language allowed per project (Need to decide on programming language when starting project).
2. We can access public functions from one page to other page.
3. Utility classes / function can be placed anywhere in the applications folder structure.
4. Web Applications are treated like other .NET projects and are managed by a project file (.csproj or .vbproj) .
5. One nice feature of the Web Application project is it's much easier to exclude files from the project view.
6. Explicit namespaces are added to pages, controls, and classes by default.
• Deployment wise difference
Web Site
1. It has its code in a special App_Code directory and it's compiled into several DLLs (assemblies) at runtime.
2. No need to recompile the site before deployment.
3. We need to deploy both .aspx file and code behind file.
4. Small changes to the site do not require a full re-deployment. (We can upload the code file that was changed)
Web Application
1. web application is precompiled into one single DLL.
2. Site has to be pre-compiled before deployment .
3. Deploy only .aspx page, but not associated code file (the pre-compiled dll will be uploaded) .
4. Even small changes require a full re-compile of the entire site(i.e. if the code for a single page changes the whole site must be compiled) (It requires careful planning to ensure new bugs aren't introduced to the production site when uploading bug fixes or other changes.)
If it helps you, do not forget to mark it as accepted.
TulasiPosted Oct 14, 2011, 3:15 AM
Website:
The Web Site project is compiled on the fly. You end up with a lot more DLL files, which can be a pain. It also gives problems when you have pages or controls in one directory that need to reference pages and controls in another directory since the other directory may not be compiled into code yet. Another problem can be in publishing.
Web Application:
The Web Application Project was created as an add-in and now exists as part of SP 1 for VS 2005. The main differences are the Web Application Project was designed to work similar to the Web projects that shipped with VS.net and VS 2003. It will compile the application into a single dll at build time. In order to update the project it must be recompiled and the dll published for changes to occur.have a look at this link
http://maordavid.blogspot.com/2007/06/aspnet-20-web-site-vs-web-application.html
Pravin PatilPosted Oct 14, 2011, 3:06 AM
Basically Web Site and Web Application is one and the same thing. The basic difference between them is Web Site is Folder Based while Web Application is Solution Based.
Let me explain you. When we create any project say Windows Application project, if you see there is project file created (csproj for C# app), also there is .sln file created. This is a solution file. This solution file is not created for the web site project, while for web application, as it solution based, .sln file is created. So when you have to open the web application you can simply double click on the .sln file and open the project. But to open the Web Site you have to go to File->Open->Web site and the select the folder where there are your web pages.
Also, If you just copy paste any file or folder in the web site folder, it will automatically get added to the Web Site Project, no need to do it like Add New Item and then selecting it. While for Web Application you have to add it from Add New Item menu only, simple copy paste will not help.
Other than this there is no difference. Web Application came later as microsoft decided to make everything solution based rather than folder based.
Hope this helps.
All the best.
If it helps you, do not forget to mark it as accepted.