Why we do not need to restart IIS after the configuration file has been modified in ASP.

Source: Internet
Author: User

This article reproduced: http://blog.itpub.net/12639172/viewspace-659819/

As you know, in ASP. NET, if we modify the configuration file as long as it is saved, it will be immediately reflected in the program,

We do not need to restart IIS. We can even replace the files under the application directly without stopping IIS, including our

Compiled DLL files and so on, all you need to do is replace the files you changed. So how does the. NET do it?

This is due to the application domain mechanism of. NET, where the application domain is smaller than the process unit of the program, which means a

The process can contain multiple application domains. Each domain is independent and does not share memory, which means that various static variables

are not shared between different domains.

With the application domain, it's okay, when we change the configuration file or replace a core DLL, the. Net

Monitoring system will report what we have done, the process of processing the ASP will recreate an application domain for the modified application, which

The new domain will react to all changes, and if a request comes in, it will be processed using the new domain, and the original

Domain will be destroyed.

In fact, each application domain does not use the DLL files that we configure in each virtual directory, and for 2.0,3.0,3.5 the real use of the

is a file under the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP. Net Files directory,

So we can directly replace files such as DLLs.

Why we do not need to restart IIS after the configuration file has been modified in ASP.

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.