Tuesday, 22 July 2014

Difference between Website and Web Application in Visual Studio.


Always, we try to create new web project in visual studio we will fund two options ASP.NET Web Application and Website.

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.
If Visual Studio isn't told to re-use the same names constantly, it will come up with new names for the DLL files generated by pages all the time. That can lead to having several close copies of DLL files containing the same class name, which will generate plenty of errors. The Web Site project was introduced with Visual Studio 2005, but it has turned out not to be extremely popular.

Web Application:

The Web Application Project was created as an add-in and now exists as part of SP 1 for Visual Studio 2005. The main differences are the Web Application Project was designed to work similar to the Web projects that shipped with Visual Studio 2003. It will compile the application into a single DLL file at build time. In order to update the project it must be recompiled and the DLL file published for changes to occur.

Its choice of the people can go for web application or website we cannot say that which one is better because both is having advantages and disadvantages. Below are the details for web application and website.

Web Application
WebSite
1. If we create any class files / functions those will be placed anywhere in the applications folder structure and it is precompiled into one single DLL.
1. If we create any class files/functions those will be placed in ASP.NET folder (App_Code folder) and it's compiled into several DLLs (assemblies) at runtime.
2. In web application we have chance of select only one programming language during creation of project either C# or VB.NET.
2. In website we can create pages in multi programming languages that means we can create one page code in C# and another page code in vb.net.
3. Whenever we create Web Application those will automatically create project files (.csproj or .vbproj).
3. Web Sites won’t create any .csproj/.vbproj files in project
4. We need to pre-compile the site before deployment.
4. No need to recompile the site before deployment.
5. If we want to deploy web application project we need to deploy only .aspx pages there is no need to deploy code behind files because the pre-compiled dll will contains these details.
5. We need to deploy both .aspx file and code behind file.

6. If we make small change in one page we need to re-compile the entire sites.
6. If we make any code changes those files only will upload there is no need to re-compile entire site.



No comments:

Post a Comment