当前位置:网站首页>[untitled] understand DNET application domain
[untitled] understand DNET application domain
2022-07-20 13:21:00 【bcbobo21cn】
Application domain
Operating systems and runtime environments often provide some form of isolation between applications . for example ,Windows Use processes to isolate applications .
The application domain is security 、 reliability 、 Version control and unloading assemblies provide isolation boundaries . Application domains are usually created by the runtime host , The runtime host is responsible for booting the common language runtime before running the application .
The application domain provides a more secure 、 More versatile processing unit , The common language runtime can use this unit to provide isolation between applications . You can have the same isolation level ( Exists in a separate process ) Several application domains run in a single process of , It will not cause additional overhead in terms of interprocess calls or interprocess switches . The ability to run multiple applications in one process significantly enhances the scalability of the server .
The isolation provided by the application domain has the following advantages :
Errors in one application will not affect other applications . Because type safe code does not cause memory errors , So using the application domain can ensure that the code running in one domain will not affect other applications in the process .
It can stop a single application without stopping the whole process . Using application domains allows you to uninstall code that runs in a single application .
Before you can execute the code contained in the assembly , The assembly must be loaded into the application domain . Running a normal application will cause several assemblies to be loaded into an application domain .
There are three options for loading domain neutral assemblies :
LoaderOptimization.SingleDomain, LoaderOptimization.MultiDomain, LoaderOptimization.MultiDomainHost;
Make a simple example program ;
using System;
using System.Reflection;
class AppDomain1
{
public static void Main()
{
Console.WriteLine(" Create an application domain ......");
AppDomain domain = AppDomain.CreateDomain("MyDomain");
Console.WriteLine("Host domain: " + AppDomain.CurrentDomain.FriendlyName);
Console.WriteLine("child domain: " + domain.FriendlyName);
Console.WriteLine("Application base is: " + domain.BaseDirectory);
Console.WriteLine("Relative search path is: " + domain.RelativeSearchPath);
Console.WriteLine("Shadow copy files is set to: " + domain.ShadowCopyFiles);
}
}
AppDomain.CurrentDomain.FriendlyName, This one is original ;
domain.FriendlyName, This is created separately ;
No output 2 Attributes may need to be set first ;
边栏推荐
- Reading the paper: retreating atmosphere revolution for semantic image segmentation
- 0055 PHP语言简介和HelloWorld
- Nacos集群搭建(转载)
- Discussion on segment tree · number of ordinary segments | number of multiplicative segments | chairman tree
- linux中yum -y install mysql为什么默认是mariadb?以及mysql yum源的配置
- . Net 7 adds the rate limiting function to easily limit the number of requests
- [Kingbase] data type formatting function
- Panda3D绘制立方体
- The new blue ocean "hard sunscreen" can't cover the 100 billion market
- I'd like to ask you something. I'm in Zhuhai now. Where is a better place to open an account? Is it safe to open a stock account by mobile phone?
猜你喜欢
Impala of CDH
Detailed explanation of feign custom configuration
"Unable to download the installation file, please check your Internet connection and try again" appears when installing visual studio2019 in win11
Is it really possible to make reports with zero coding?
【无标题】了解dNet应用程序域
Write "Hello, china." for domestic smart watches with C #
How can I use coreldrawx8 for free when the trial expires? cdrX8
美国土安全部无授权下追踪国内外民众手机定位 花费数百万美元
Web3将如何改变人来的未来?
QIODevice
随机推荐
【无标题】了解dNet应用程序域
性能提升30倍丨基于 DolphinDB 的 mytt 指标库实现
12. Talk about the implementation principle of single sign on in the project?
dotnet 读 WPF 源代码笔记 渲染收集是如何触发
[dataset production] annotation tool
Hackers crack gambling website vulnerabilities and "collect wool" 100000 per month
Go语言 常量与运算符
DashboardClient
linux中yum -y install mysql为什么默认是mariadb?以及mysql yum源的配置
Feign's introduction to fast practice
日期类的简易实现
Upgrading thinking from engineer to technical leader
Dynamic memory management
構建工具
如何进行「小步重构」?
早期肺结核检测
Use onedns to perfectly solve the optimization problem of office network
关于部署ogg 微服务的一些疑问
NGFW的用户认证
Outils de construction