Resources » .NET programming » ASP.NET/Web Applications

Difference between web site and web application in Visual Studio 2005


Posted Date: 19-Apr-2006  Last Updated:   Category: ASP.NET/Web Applications    
Author: Member Level: Gold    Points: 10


This article explains the concept of web site and web application in Visual Studio 2005



Introduction



If you are not very familiar with Visual Studio 2005, a "web site" and "web application project" may sound the same for you.

Microsoft introduced the concept of "website" instead of "web application" in Visual Studio 2005. However, due to demand from the development community, they re introduced the "web Application Project" which is pretty much similar to Visual Studio 2003 web application.

Web site in Visual Studio 2005



A web site is just a group of all files in a folder and sub folders. There is no project file. All files under the specific folder - including your word documents, text files, images etc are part of the web site.

You have to deploy all files including source files (unless you pre compile them) to the server. Files are compiled dynamically during run time.

To create a "web site", you need to use the menu File > New > Website

You will have the option to choose either one of the following location types:

  • File System - Allows you to choose a folder to put all the files.
  • Http - Allows you to choose a virtual directory to put the files.
  • FTP - Allows you to choose an ftp location.

    In any of the above cases, no project file is created automatically. Visual Studio considers all files under the folder are part of the web site.

    There will be no single assembly created and you will nto see a "Bin" folder.

    The benefits of this model is, you do not need a project file or virtual directory to open a project. It is very handy when you share or download code from the internet. You just need to copy the downloaded code into a folder and you are ready to go!

    How to open a web site, if there is no project file?



    It looks bit confusing until you get familiar with the Visual Studio 2005 programming model.

    To open a web site (which do not have a project file), you need to first open Visual Studio 2005 and choose the menu File > Open > Website. It allows you to select a folder (not a project file). Thats all you have to do to view all the files part of the web site.

    Disadvantages of web site model



    Since there is no project file, there is nothing that you can double click to open the web site in Visual Studio for editing. You have to open Visual Studio first and then open the site from VS2005.

    Another disadvantage is, all files under the folder and considered to be part of the web site. There are lot of legacy web sites where more than one web site is combined into one folder, but properly managed the files by including them in appropriate projects. With the new model, since there is no project file, all files are considered to be part of the same website.

    How to exclude a file from a web site in VS2005?



    Many programmers keep lot of document files and backup files under the project folder. With the new model, they are all part of the web site. If you have backup files which has same class names, you may get compilation problems when they are compiled dynamically sicne they will be treated as duplicate classes. The only way you can exclude a file from the website within the same directory is by renaming them with the extension .exclude

    Web Application Project in Visual Studio 2005



    Microsoft introduced the "web site" concept where all files under a web site are part of the site, hoping that the development community is going to love that. In fact, this is very usefull to share code.

    However, they did not consider millions of existing web applications where people are comfortable with the "project" based application. Also, there were lot of web applications where several un wanted files were kept under the web site folder. So, the new model did not work well for them.

    When people started screaming, Microsoft came up with the answer. On April 7, 2006, they announced "Visual Studio 2005 Web Application Projects" as an Add-On to Visual Studio 2005. This Add-On will allow you to create and use web applications just like the way it used to be in Visual Studio 2003.

    The Visual Studio 2005 Web Application Project model uses the same project, build and compilation method as the Visual Studio .NET 2003 web project model.

    All code files within the project are compiled into a single assembly that is built and copied in the Bin directory.

    All files contained within the project are defined within a project file (as well as the assembly references and other project meta-data settings). Files under the web's file-system root that are not defined in the project file are not considered part of the web project.

    Which is best for me - Web site or web application project?



    Both has it's own advantages and disadvantages.

    A web site is good for you if you just want to create web sites and share with others. It is ideal for new projects.

    However, "web application project" is better if you are planning to migrate your Visual Studio 2003 or 2002 web sites into Visual Studio 2005. Otherwise you may end up spending lot of time to exclude unwanted files from your web site folder.

    Download Visual Studio 2005 Web Application Projects (RC1)



    As of April 2006, this is an Add-On to Visual Studio and not yet official released. You can download the beta version from here -

    http://msdn.microsoft.com/asp.net/reference/infrastructure/wap/

    In future, this add on might become part of Visual Studio.

    Comments and Feedback welcome



    Please use the feedback link below to post your comments and feedback.


  • Did you like this resource? Share it with your friends and show your love!

    Responses to "Difference between web site and web application in Visual Studio 2005"
    Author: Vasudevan Deepak Kumar    13 Jun 2007Member Level: Gold   Points : 0
    It was really very informative and saved a bit of time now. When I researched still more, I found that SP1 now integrates it into the host product. Check out http://msdn2.microsoft.com/en-us/asp.net/aa336618.aspx


    Author: ranjit cherian    03 Dec 2007Member Level: Bronze   Points : 0
    thaks


    Author: Seepee Saxena    03 Dec 2009Member Level: Bronze   Points : 0
    This is really nice article and easy to understand.
    Thanks.



    Author: Rashmi Bhimani    01 Jun 2010Member Level: Bronze   Points : 0
    Thank you, Useful article - detailed information.


    Author: Debasmit Samal    01 Jun 2010Member Level: Gold   Points : 1
    http://www.codersbarn.com/post/2008/06/ASPNET-Web-Site-versus-Web-Application-Project.aspx

    http://bytes.com/topic/asp-net/answers/613134-difference-between-web-site-web-application-project



    Author: Santosh Kumar Singh    16 Jun 2010Member Level: Gold   Points : 0
    good article....
    thnaks



    Author: saravanan    17 Jun 2010Member Level: Gold   Points : 0
    Nice and Helpful article...
    Keep it up!!!!



    Author: Sanchi    21 Jul 2010Member Level: Silver   Points : 0
    Good Article

    Thanks,Sanchi



    Author: Biju    05 Aug 2010Member Level: Gold   Points : 2
    USE [VKSRETANIUM]
    GO
    /****** Object: StoredProcedure [dbo].[Search_Company] Script Date: 08/05/2010 12:45:57 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO

    ALTER PROCEDURE [dbo].[Search_Company]
    (@Expression VARCHAR(8000))
    AS
    DECLARE @Qry VARCHAR(8000)
    BEGIN
    SET @Qry ='SELECT
    [Id]
    ,[Name]
    ,[CompanyContactId]
    ,[ContactPersonId]
    ,[IdentificationId]
    ,[CreatedBy]
    ,[CreatedDate]
    ,[ModifiedBy]
    ,[ModifiedDate]
    ,[ActiveStatus]
    ,[StoreId]
    ,[LedgerId]
    ,[CostCenterId]
    ,

    ,[SyncServerId]
    from [Company]
    where '
    + @Expression
    EXEC (@Qry)
    END



    Author: Alex Kumar    05 Aug 2010Member Level: Gold   Points : 0
    Nice Article


    Author: ghjjfgnj    20 May 2011Member Level: Silver   Points : 1
    web application is that application which is not uploaded


    web site is uploaded, it has port number, host name



    Author: ketan Italiya    02 Aug 2013Member Level: Gold   Points : 0
    hmm..right web-application can't uploaded.
    when website is uploaded..both are run on server.both's diff. is so much interesting.this information is helpful.



    Feedbacks      

    Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Submit Article     Return to Article Index

    Subscribe to Subscribers
    Awards & Gifts
    Talk to Webmaster Tony John

    Online Members

    Nirav Prabtani
    More...
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India