AppDomainManager.CreateDomain(String, Evidence, AppDomainSetup) AppDomainManager.CreateDomain(String, Evidence, AppDomainSetup) AppDomainManager.CreateDomain(String, Evidence, AppDomainSetup) AppDomainManager.CreateDomain(String, Evidence, AppDomainSetup) Method


返回新的或现有的应用程序域。Returns a new or existing application domain.

 virtual AppDomain ^ CreateDomain(System::String ^ friendlyName, System::Security::Policy::Evidence ^ securityInfo, AppDomainSetup ^ appDomainInfo);
public virtual AppDomain CreateDomain (string friendlyName, System.Security.Policy.Evidence securityInfo, AppDomainSetup appDomainInfo);
abstract member CreateDomain : string * System.Security.Policy.Evidence * AppDomainSetup -> AppDomain
override this.CreateDomain : string * System.Security.Policy.Evidence * AppDomainSetup -> AppDomain
Public Overridable Function CreateDomain (friendlyName As String, securityInfo As Evidence, appDomainInfo As AppDomainSetup) As AppDomain


String String String String

域的友好名称。The friendly name of the domain.

Evidence Evidence Evidence Evidence

一个对象,其中包含通过安全策略映射的证据,这些证据用于建立堆栈顶层的权限集。An object that contains evidence mapped through the security policy to establish a top-of-stack permission set.

AppDomainSetup AppDomainSetup AppDomainSetup AppDomainSetup

包含应用程序域初始化信息的对象。An object that contains application domain initialization information.


新的或现有的应用程序域。A new or existing application domain.


friendlyName参数指定的友好名称可在用户界面中显示以标识域。The friendly name, specified by the friendlyName parameter, can be displayed in user interfaces to identify the domain. 有关更多信息,请参见 FriendlyName 属性。For more information, see the FriendlyName property.

默认CreateDomain方法调用受保护CreateDomainHelper的方法来创建AppDomainThe default CreateDomain method calls the protected CreateDomainHelper method to create the AppDomain. 此方法的重写不需要调用方法, CreateDomainHelper但可以返回现有域。Overrides of this method do not need to call the CreateDomainHelper method but can return an existing domain.


当从AppDomainManager类继承并重CreateDomain(String, Evidence, AppDomainSetup)写方法时, 可以在调用CreateDomainHelper(String, Evidence, AppDomainSetup)方法之前执行自定义应用程序域初始化活动, 或者根本不调用帮助程序方法。When you inherit from the AppDomainManager class and override the CreateDomain(String, Evidence, AppDomainSetup) method, you can perform custom application domain initialization activities before calling the CreateDomainHelper(String, Evidence, AppDomainSetup) method, or not call the helper method at all. 例如, 你可以修改作为securityInfo传入的证据, 更新关联AppDomainSetup的字段, 或重复使用现有域。For example, you could modify the evidence passed in as securityInfo, update the fields of the associated AppDomainSetup, or reuse an exiting domain.