Differences between web applications and websites in Visual Studio

Source: Internet
Author: User

Both vs2005, vs2008, and vs2010 have created web applications.ProgramAnd Web websites.

Web applications may be retained by Microsoft to enable programmers to transition from winform to web development. Web websites must be fully applied to web development. In fact, there is no big difference between the two. I have summarized their similarities and differences from the appearance.
Same:
1. asp web pages are designed.
2. You can add ASP. NET folders (including app_browsers, app_data, app_globalresources, app_localresources, and app_themes ).
Different:
1. Web application default. aspx displays two original files and default. aspx. CS and default. aspx. designer. CS; Web site default. aspx displays an existing file default. aspx. CS.
2. There are two types of Web applications: re-emergence and release. One web site has only one publishing site.
3. There is no difference between a web application and a general winform in referencing namespaces. After referencing a web site, a bin folder appears, where DLL and PDB files are stored.
4. Web applications can be referenced as class libraries. Web websites cannot be referenced as class libraries.
5. You can add bin and app_code to ASP. NET folders for Web applications. You can add ASP. Net folders Including bin and app_code to a Web site.
6. You can also add components and classes to Web applications, but not to Web websites.

7. Although the source files are all default. aspx. CS, the Web application has a namespace and an additional system. Collections space reference is provided.

No Web application project exists in vs. net2005. Only the new website can be created. The Web application function is added in SP1. This feature is available to many friends who developed the website vs. net2003.

In the "website" project of vs2005. In fact, it also has some advantages. The Web Application in vs2003 and vs2005sp1 is to compile the entire website application into a DLL. The website project generatesCodeFile, compiled separately. The code file in the special directory app_code is compiled into a separate assembly. This design. A page and the page assembly can be generated separately. You can only update this page during upload.

However, the Compilation speed of this "website" project is slow, and the type check is incomplete. Two different aspx classes can be generated with the same two names. The release is also slow. It will delete all the files in the original release directory and copy all the new files. There is a pause in the middle. You must manually press the overwrite button to publish the file.

In the web application of Sp1, the compilation and publishing speed is significantly faster. You can set whether to overwrite the content at the beginning of the release. To upgrade your website, you must generate a design code page. With this file, the compiler does not need to analyze the ASPX page during compilation. This significantly accelerates compilation. Only one assembly is generated. The execution speed page is faster.

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.

Generated Assembly 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, therefore, like other projects, you can specify information such as the application Assembly name, version, and output location.

You can split your website into multiple projects for easy management.

From the project andSource codeExclude a file from management

Support for vsts team build to facilitate daily building

More powerful code check function, and check policy is controlled by source code

You can perform prescribed processing before and after compilation.

Strong Resource class support for app_globalresources (I have not learned about it on the Internet)

Directly upgrade a large system built using vs2003

Advantages of the website programming model:

Dynamically compile the page to see the effect immediately without compiling the entire site (main advantages)

Same as above, it can make the error part and the part used irrelevant (it can be required that only the compilation can be passed in)

One assembly can be generated on each page (this method is not used)

A directory can be processed as a web application, and files can be directly copied and published without project files (it doesn't matter, it is only suitable for small sites)

You can also compile the page into the assembly (it should not be used, and webapplication can also be implemented through the webdeployment plug-in)

Mutual conversion between the two programming models:

Vs2005 SP1 has a built-in Conversion Program, which can easily switch from website to webapplication by copying files and right-clicking and executing "convert to Web application. No dedicated reverse Conversion Tool is found, but after comparison, it is also very easy to convert.

Delete all *. designer. CS will *. aspx ,*. ascx ,*. codebehind = "filelist. aspx. CS "batch Replace with codefile =" filelist. aspx. CS"

Many new users do not understand the difference between websites and web applications when creating projects in.

1. When a web application is opened, all projects are compiled. Therefore, opening a web application is slow at the beginning, but the subsequent running is faster.

The website compiles the page when accessing every page, so the speed of accessing every page is almost the same.

2. Based on the above reasons

The Web application needs to be re-compiled after the underlying code of the page is modified.

The website does not need to be re-compiled

3. You can add APS folders for websites, but not for Web applications.

4. a dll file is generated for a Web application project.

When the website is released, the DLL file is automatically generated, but the DLL file names are different each time.

5. Web applications have solutions and project files

Related Article

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.