Application domain AppDomain in C #

Source: Internet
Author: User
<span id="Label3"></p><pre class="best-text mb-10"><pre class="best-text mb-10">first, describe what the AppDomain is: when an assembly is executed, the system automatically creates an AppDomain for it, each of which belongs to a process, and a process can have multiple AppDomain Each AppDomain is created with a default name, which is the name of the loaded assembly (with the Extension. exe).<br>Different Appdomian within the same Windows process can share resources with each other, such as: CLR, basic. NET types, address spaces, and THREADS.<br>Calls to assemblies in the appdomain: within the same process, if different AppDomain calls the same assembly, there are two scenarios:<br>1. The assembly is loaded in each AppDomain and called by the appdomain;<br>2. The assembly will be loaded in the process, not in any appdomain, and all AppDomain within the same process can invoke it. The assembly (Assembly) that is loaded in this way is called Domain-independent (Neutral).<br>The relationship between the AppDomain and the thread is orthogonal to The;n<--->n.<br>Note that when an AppDomain loads a assembly, it cannot unload it separately, but it can be said that the AppDomain is Unloaded.<br>When you unload an appdomain, the CLR unloads all the threads that are currently executing in that appdomain, which can cause problems when executing unmanaged code, and all managed objects in the AppDomain will be forcibly reclaimed by the garbage collector;<br>The isolation of the appdomain:<br>1), an AppDomain can be unloaded independently of the other appdomain;<br>2), an AppDomain can not be asked in other AppDomain assembly and objects;<br>3), if no cross-boundary exception is thrown, an AppDomain has its own exception management Strategy. This means that an exception in one AppDomain within the same process does not affect the other appdomain.<br>4) each AppDomain can define its own assembly code access security policy;<br>5), each AppDomain can define its own rules so that the location of the assembly is located before the CLR loads</pre></pre><p><p> Application domain AppDomain in C # </p> </p></span>

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.