Application domains (application domain)

Source: Internet
Author: User

application domains provide a flexible and secure way to isolate running applications.

Application domains are typically created and manipulated by the runtime host. Sometimes, you might want your application to programmatically interact with an application domain, such as when you want to unload a component without stopping the application from running.

application domains help improve security by separating applications and application data from each other. a single process can run multiple application domains and have an isolation level that exists in a separate process. running multiple applications in a single process improves the scalability of the server.

The following code example creates a new application domain and then loads and executes the previously generated assembly , HelloWorld.exe, which is stored on drive C.

// Create an application Domain: System.AppDomain NewDomain = System.AppDomain.CreateDomain ("newapplicationdomain") ; // Load and execute an assembly:newdomain.executeassembly (@ "c:\HelloWorld.exe" ); // Unload the application domain: System.AppDomain.Unload (NewDomain);

Application domains have the following characteristics:

    • Before the assembly can be executed, the assembly must be loaded into the application domain.

    • An error in one application domain does not affect other code that runs in another application domain.

    • The ability to stop a single application and unload code without stopping the entire process. You cannot unload individual assemblies or types, only the entire application domain.

Application domains (application domain)

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.