April 13, 2011

ASP.NET WebSite Vs WebApplication

 

The 'web site' model was introduced with ASP.NET 2.0, the 'web application' model was the project type of the original .net framework. Web Application project we need to do explicit build.

Web Site lets you treat it like a PHP or classic ASP site, where you can make inline changes that take effect immediately.

Pros

  • You can make tweaks to the site right on the web server
  • Deploying is as simple as copying the folder

Cons

  • If you are not making the changes right on the live site, you can get into change management problems, where you forget to keep all your files in sync
  • You can get runtime syntax errors displayed to your end users, since the only way to check is to manually run every page

For me the personal preference is Web-Application rather than  Web Site as we can get  lot of trouble when we making arbitrary changes to code-behind file in notepad while the website is running.

If it is an ASP.NET Web Application project, then you need to do a build before you post the dll to production and unless we build the files cannot get updated. This is more secured and preferred ,been used for years. As we do not want to put source code in the production server.

Website model by default source code files sit in production and what ever you change that gets automatically gets compiled and updated when you save. In Website model we need to move Code Files and also ASPX Files into the production.

1 comment:

Arun Kakkar said...

Thanks Ms Hema
You put a very interesting topic here, here you mentioned how to deploy website by just copy & paste your website to production server.
I would be glad if you put the little detail process of deploying asp.net web application project on production server to get more clear idea of difference between asp.net web application & website for novice programmer of dot net like me.

Thank you very much for your effort , you put so far to share your good knowledge.

There was an error in this gadget