ASP.NET Website vs Web Application project


  1. When you add a class file to the website project it will prompt you that it will place the file in App_code folder under root.

    Notice In website project type namespace won't add to the class by default however you can define the namespaces explicitly where as in WebApp it creates the namespace for the class file when you added it to the project.
  2. WebApp project type is restricted to one language where as Website you can add different language files to the App_Code folder which compiles the files dynamically.
     
  3. Referring a user control in WebApp is straight forward.You can define the properties and can be accessed in class files like any other objects where as in website it is not.
     
  4. We can put multiple language files in the Website but those files needs to be in same folder. If you change the location of the file then you need to mention in the Web.Config file as follows..

    <codeSubDirectories> 
    <add directoryName="Testfolder"/> 
    </codeSubDirectories>

    In compilation process you will have the finer degree of control in WebApp and it is not in Website because everything is dynamically compiled.
     
  5. When you deploy the WebApps you can just copy the Compiled Assembly and Visual elements to the IIS folder where as in Website you need to copy everything to the IIS to work.

    for more information

    pls refer this link http://msdn.microsoft.com/en-us/library/dd547590.aspx
    or
    Scenarios in which web application projects are the preferred choice include the following:
    • You want to be able to use the Edit and Continue feature of the Visual Studio debugger.
    • You want to run unit tests on code that is in the class files that are associated with ASP.NET pages.
    • You want to refer to the classes that are associated with pages and user controls from standalone classes.
    • You want to establish project dependencies between multiple web projects.
    • You want the compiler to create a single assembly for the entire site.
    • You want control over the assembly name and version number that is generated for the site.
    • You want to use MSBuild or Team Build to compile the project. For example, you might want to add prebuild and postbuild steps.
    • You want to avoid putting source code on a production server.
    Scenarios in which Web site projects are the preferred choice include the following:
    • You want to include both C# and Visual Basic code in a single web project. (By default, a web application is compiled based on language settings in the project file. Exceptions can be made, but it is relatively difficult.)
    • You want to open the production site in Visual Studio and update it in real time by using FTP.
    • You do not want to have to explicitly compile the project in order to deploy it.
    • If you do precompile the site, you want the compiler to create multiple assemblies for the site, which can include one assembly per page or user control, or one or more assemblies per folder.
    • You want to be able to update individual files in production by just copying new versions to the production server, or by editing the files directly on the production server.
    • If you precompile the site, you want to be able to update individual ASP.NET web pages (.aspx files) without having to recompile the entire site.
    • You like to keep your source code on the production server because it can serve as an additional backup copy.

Comments

Popular posts from this blog

what is Event Cache table in sharepoint

CAML Query syntax and options in SharePoint

Change anchor link url in sharepoint calender