Difference between web site and Web Application

Source: Internet
Author: User

Difference between website and web application

"Website" is managed based on the file directory. All files in the folder are part of the project and can be run directly by setting IIS to the Development Directory. It is a very suitable mode for web development. It does not have a project file and does not need to be compiled for debugging. It is a new model launched by vs2005.

"ApplicationProgram"Is the basic unit of project management. It is prepared for componentized development. It has project files and requires compilation and release, which is suitable for development and use by the team. However, it is not very suitable for the web development mode. It is mainly designed to be compatible with win development methods and is a legacy mode.

Some developers think that Web site projects are more natural and convenient to use. Other developers prefer to clearly define the resources and files used in the project, instead, as long as files under the root directory of the website are website resources (although file exclusion is also available in the web site, it is implemented by modifying the file suffix, the method is different from that recorded in the project file in the Web application ).

The following is a comparison between the Web site and web application in different situations.

Option or task

Web application projects

Web site projects

Migrate large Visual Studio. NET 2003 applications to Visual Studio 2005.

X

 

Do not want to useCodeSeparation Technology.

 

X

It is expected that the page can be dynamically compiled during development without modifying each file. After saving the page, you can manually compile the page. Instead, you can refresh the page to see the modification effect.

 

X

You need to control the name, version, output location, and other information of the Assembly generated by the project.

X

 

An independent assembly must be generated for each page.

 

X

Use independent classes to introduce page controls and user controls.

X

 

Use multiple web projects to generate Web applications.

X

 

Add the pre-build and post-build steps during the compilation process.

X

 

You need to directly use an independent folder as a web project without creating a project file.

 

X

The following table lists the important differences between web application and web site.

Situation

Web Application Project

Web Site Project

project definition

only files referenced in the Web application solution are part of the project. These files are also displayed in Solution Explorer and compiled during generation. Due to the existence of project files, some solutions are easier to implement. For example, you can divide an ASP. NET application into multiple Visual Studio projects. You can also easily exclude files from the project and Source Code .

the web site uses the document structure to manage project files. It does not include project files. All files in the folder are part of the project

applicable to the website directories that do not contain the existing project files.

Compile and generate output

All program code files and independent files in the project are compiled into an assembly and saved in the bin folder. You can specify the Assembly name, version, output location, and other information.

When a command is generated in a web site project, the Assembly is not generated, but the web site is verified. When running the web site, the pages and class source files are dynamically compiled and deployed by Asp.net.

At the same time, you can also pre-compile the site to improve performance. In the pre-compilation, the same technology as dynamic compilation is used.

Asp.net pre-compilation has 2 medium mode. batch mode (the default) and fixed-names mode. batch mode to generate an assembly. Fixed mode on each page, the user control generates an independent assembly.

Development

You need to compile the entire project before running and debugging the program, but the web application Compilation speed is usually very fast, because the incremental compilation mode is used, only after the file is modified, this part will be incrementally compiled.

Because dynamic compilation is used and compiled to different sets, you do not need to compile the entire project successfully when accessing or debugging a specific page.

The Generation Command will verify the entire project, but the speed is slow. Therefore, we recommend that you compile the current page only during development and debugging.

Deployment

Because all the code files are generated as an assembly, you only need to deploy the page files such as the Assembly and. aspx to the server.

The. aspx file is compiled only when it is accessed by the browser.

Every time an assembly is updated, all Page code is replaced.

You can use the publish command to compile both the. aspx file and the background code file into the Assembly. If you select updateable publish option, you only need to compile the background code.

The default mode will generate an assembly for each folder. The fixed name mode will generate an assembly for each page, but it may cause extra burden on the storage space.

Upgrade from Visual Studio. NET 2003

As it works in the same way as. NET 2003, there is basically no need for too many operations.

You need to use the Upgrade Wizard and some additional operations.

.

Advantages of the webapplication programming model: ZC javasbej? À BBS .51aspx.com comment â ˆ OD "] é Yun
● The website Compilation speed is fast and the incremental compilation mode is used. This part will be incrementally compiled only after the file is modified. ZC describej? À BBS .51aspx.com comment â ˆ OD "] é Yun
● The generated Assembly ZC has bej? À BBS .51aspx.com comment â ˆ OD "] é Yun
Website: generate a random Assembly name. You must use the plug-in webdeployment to generate a single assembly webapplication: You can specify a website project to generate a single assembly because it is an independent assembly, so, like other projects, you can specify information such as the application Assembly name, version, and output location ZC javasbej? À BBS .51aspx.com comment â ˆ OD "] é Yun
● Can the website be split into multiple projects to facilitate ZC describej management? À BBS .51aspx.com comment â ˆ OD "] é Yun
● Can ZC javasbej be excluded from the project and source code management? À BBS .51aspx.com comment â ˆ OD "] é Yun
● Support for vsts team build to build ZC javasbej on a daily basis? À BBS .51aspx.com comment â ˆ OD "] é Yun
● More powerful code check function, and the check policy is controlled by the source code ZC javasbej? À BBS .51aspx.com comment â ˆ OD "] é Yun
● Can I handle ZC javasbej as required before and after compilation? À BBS .51aspx.com comment â ˆ OD "] é Yun
● The resource class of app_globalresources supports ZC javasbej? À BBS .51aspx.com comment â ˆ OD "] é Yun
● Directly upgrade ZC javasbej, a large-scale system built using vs2003? À BBS .51aspx.com comment â ˆ OD "] é Yun
Advantages of the website programming model: ZC javasbej? À BBS .51aspx.com comment â ˆ OD "] é Yun
● Dynamically compile the page to see the effect immediately. do not compile the entire site (main advantage) ZC javasbej? À BBS .51aspx.com comment â ˆ OD "] é Yun
● Same as above, can we make the error part and the used part irrelevant to ZC describej? À BBS .51aspx.com comment â ˆ OD "] é Yun
● Can an assembly ZC javasbej be generated on each page? À BBS .51aspx.com comment â ˆ OD "] é Yun
● A directory can be processed as a web application, and files can be directly copied and published without the project file ZC javasbej? À BBS .51aspx.com comment â ˆ OD "] é Yun
● Can I compile the page into the ZC javasbej? À BBS .51aspx.com comment â ˆ OD "] é Yun
Mutual conversion between the two programming models: ZC javasbej? À BBS .51aspx.com comment â ˆ OD "] é Yun
Vs2005 SP1 has a built-in Conversion Program, which can be easily converted from website to webapplicationzc javasbej? À BBS .51aspx.com comment â ˆ OD "] é Yun
You only need to copy the file and right-click to execute "convert to Web application. ZC describej? À BBS .51aspx.com comment â ˆ OD "] é Yun
No dedicated reverse Conversion Tool is found, but after comparison, it is also very easy to convert. ZC describej? À BBS .51aspx.com comment â ˆ OD "] é Yun
*. Designer. cszc describej? À BBS .51aspx.com comment â ˆ OD "] é Yun
*. Aspxzc describej? À BBS .51aspx.com comment â ˆ OD "] é Yun
*. Ascxzc describej? À BBS .51aspx.com comment â ˆ OD "] é Yun
*. Masterzc describej? À BBS .51aspx.com comment â ˆ OD "] é Yun
Delete all *. Designer. cszc connector bej? À BBS .51aspx.com comment â ˆ OD "] é Yun
Replace codebehind = "filelist. aspx. cs" in the *. aspx, *. ascx, and *. Master page files with codefile = "filelist. aspx. cs" ZC describej? À BBS .51aspx.com comment â ˆ OD "] é Yun
In short, large websites are more suitable for webapplication projects, while small websites are more suitable for website projects.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.