AppDomain.CreateDomain 方法

定義

建立新的應用程式定義域。Creates a new application domain.

多載

CreateDomain(String, Evidence, String, String, Boolean, AppDomainInitializer, String[])

使用辨識項、應用程式基底路徑、相對搜尋路徑和指定是否要將組件的陰影複本載入應用程式定義域的參數,建立具有指定名稱的新應用程式定義域。Creates a new application domain with the given name, using evidence, application base path, relative search path, and a parameter that specifies whether a shadow copy of an assembly is to be loaded into the application domain. 指定當初始化應用程式定義域時所叫用的回呼方法,以及要傳遞給該回呼方法的字串引數陣列。Specifies a callback method that is invoked when the application domain is initialized, and an array of string arguments to pass the callback method.

CreateDomain(String, Evidence, String, String, Boolean)

使用辨識項、應用程式基底路徑、相對搜尋路徑和指定是否要將組件的陰影複本載入應用程式定義域的參數,建立具有指定名稱的新應用程式定義域。Creates a new application domain with the given name, using evidence, application base path, relative search path, and a parameter that specifies whether a shadow copy of an assembly is to be loaded into the application domain.

CreateDomain(String, Evidence, AppDomainSetup, PermissionSet, StrongName[])

使用指定之名稱、辨識項、應用程式定義域設定資訊、預設權限集合及完全信任的組件陣列,建立新的應用程式定義域。Creates a new application domain using the specified name, evidence, application domain setup information, default permission set, and array of fully trusted assemblies.

CreateDomain(String, Evidence)

使用提供的辨識項,建立具有指定名稱的新應用程式定義域。Creates a new application domain with the given name using the supplied evidence.

CreateDomain(String)

建立具有指定名稱的新應用程式定義域。Creates a new application domain with the specified name.

CreateDomain(String, Evidence, AppDomainSetup)

使用指定名稱、辨識項和應用程式定義域安裝資訊,建立新的應用程式定義域。Creates a new application domain using the specified name, evidence, and application domain setup information.

CreateDomain(String, Evidence, String, String, Boolean, AppDomainInitializer, String[])

使用辨識項、應用程式基底路徑、相對搜尋路徑和指定是否要將組件的陰影複本載入應用程式定義域的參數,建立具有指定名稱的新應用程式定義域。Creates a new application domain with the given name, using evidence, application base path, relative search path, and a parameter that specifies whether a shadow copy of an assembly is to be loaded into the application domain. 指定當初始化應用程式定義域時所叫用的回呼方法,以及要傳遞給該回呼方法的字串引數陣列。Specifies a callback method that is invoked when the application domain is initialized, and an array of string arguments to pass the callback method.

public:
 static AppDomain ^ CreateDomain(System::String ^ friendlyName, System::Security::Policy::Evidence ^ securityInfo, System::String ^ appBasePath, System::String ^ appRelativeSearchPath, bool shadowCopyFiles, AppDomainInitializer ^ adInit, cli::array <System::String ^> ^ adInitArgs);
public static AppDomain CreateDomain (string friendlyName, System.Security.Policy.Evidence securityInfo, string appBasePath, string appRelativeSearchPath, bool shadowCopyFiles, AppDomainInitializer adInit, string[] adInitArgs);
static member CreateDomain : string * System.Security.Policy.Evidence * string * string * bool * AppDomainInitializer * string[] -> AppDomain
Public Shared Function CreateDomain (friendlyName As String, securityInfo As Evidence, appBasePath As String, appRelativeSearchPath As String, shadowCopyFiles As Boolean, adInit As AppDomainInitializer, adInitArgs As String()) As AppDomain

參數

friendlyName
String

定義域的易記名稱。The friendly name of the domain. 這個易記名稱可以在使用者介面中顯示以識別該定義域。This friendly name can be displayed in user interfaces to identify the domain. 如需詳細資訊,請參閱FriendlyNameFor more information, see FriendlyName.

securityInfo
Evidence

辨識項,可建立能在應用程式定義域內執行之程式碼的識別。Evidence that establishes the identity of the code that runs in the application domain. 傳遞 null 可使用目前應用程式定義域的辨識項。Pass null to use the evidence of the current application domain.

appBasePath
String

組件解析程式用來探查組件的基底目錄。The base directory that the assembly resolver uses to probe for assemblies. 如需詳細資訊,請參閱BaseDirectoryFor more information, see BaseDirectory.

appRelativeSearchPath
String

相對於組件解析程式應該探查私用組件之基底目錄的路徑。The path relative to the base directory where the assembly resolver should probe for private assemblies. 如需詳細資訊,請參閱RelativeSearchPathFor more information, see RelativeSearchPath.

shadowCopyFiles
Boolean

true 表示將組件的陰影複本載入到應用程式定義域中。true to load a shadow copy of an assembly into the application domain.

adInit
AppDomainInitializer

AppDomainInitializer 委派,表示當初始化新的 AppDomain 物件時所叫用的回呼方法。An AppDomainInitializer delegate that represents a callback method to invoke when the new AppDomain object is initialized.

adInitArgs
String[]

當初始化新的 AppDomain 物件時,要傳遞給由 adInit 代表的回呼之字串引數陣列。An array of string arguments to be passed to the callback represented by adInit, when the new AppDomain object is initialized.

傳回

AppDomain

新建立的應用程式定義域。The newly created application domain.

例外狀況

friendlyNamenullfriendlyName is null.

備註

所表示的方法 adInit 會在新建立之應用程式域的內容中執行。The method represented by adInit is executed in the context of the newly created application domain.

如果 securityInfo 未提供,則會使用來自目前應用程式域的辨識項。If securityInfo is not supplied, the evidence from the current application domain is used.

如需陰影複製的詳細資訊,請參閱 ShadowCopyFiles陰影複製元件For more information about shadow copying, see ShadowCopyFiles and Shadow Copying Assemblies.

重要

請勿使用這個方法多載來建立沙箱應用程式域。Do not use this method overload to create sandboxed application domains. 從 .NET Framework 4 開始,提供的辨識項不再 securityInfo 影響應用程式域的授權集。Beginning with the .NET Framework 4, the evidence that is supplied for securityInfo no longer affects the grant set of the application domain. 您可以使用方法多載 CreateDomain(String, Evidence, AppDomainSetup, PermissionSet, StrongName[]) 來建立沙箱應用程式域。Use the CreateDomain(String, Evidence, AppDomainSetup, PermissionSet, StrongName[]) method overload to create sandboxed application domains.

適用於

CreateDomain(String, Evidence, String, String, Boolean)

使用辨識項、應用程式基底路徑、相對搜尋路徑和指定是否要將組件的陰影複本載入應用程式定義域的參數,建立具有指定名稱的新應用程式定義域。Creates a new application domain with the given name, using evidence, application base path, relative search path, and a parameter that specifies whether a shadow copy of an assembly is to be loaded into the application domain.

public:
 static AppDomain ^ CreateDomain(System::String ^ friendlyName, System::Security::Policy::Evidence ^ securityInfo, System::String ^ appBasePath, System::String ^ appRelativeSearchPath, bool shadowCopyFiles);
public static AppDomain CreateDomain (string friendlyName, System.Security.Policy.Evidence securityInfo, string appBasePath, string appRelativeSearchPath, bool shadowCopyFiles);
static member CreateDomain : string * System.Security.Policy.Evidence * string * string * bool -> AppDomain
Public Shared Function CreateDomain (friendlyName As String, securityInfo As Evidence, appBasePath As String, appRelativeSearchPath As String, shadowCopyFiles As Boolean) As AppDomain

參數

friendlyName
String

定義域的易記名稱。The friendly name of the domain. 這個易記名稱可以在使用者介面中顯示以識別該定義域。This friendly name can be displayed in user interfaces to identify the domain. 如需詳細資訊,請參閱FriendlyNameFor more information, see FriendlyName.

securityInfo
Evidence

辨識項,可建立能在應用程式定義域內執行之程式碼的識別。Evidence that establishes the identity of the code that runs in the application domain. 傳遞 null 可使用目前應用程式定義域的辨識項。Pass null to use the evidence of the current application domain.

appBasePath
String

組件解析程式用來探查組件的基底目錄。The base directory that the assembly resolver uses to probe for assemblies. 如需詳細資訊,請參閱BaseDirectoryFor more information, see BaseDirectory.

appRelativeSearchPath
String

相對於組件解析程式應該探查私用組件之基底目錄的路徑。The path relative to the base directory where the assembly resolver should probe for private assemblies. 如需詳細資訊,請參閱RelativeSearchPathFor more information, see RelativeSearchPath.

shadowCopyFiles
Boolean

如果為 true,則會將組件的陰影複本載入這個應用程式定義域中。If true, a shadow copy of an assembly is loaded into this application domain.

傳回

AppDomain

新建立的應用程式定義域。The newly created application domain.

例外狀況

friendlyNamenullfriendlyName is null.

範例

下列範例通常會示範如何使用其中一個多載來建立網域 CreateDomainThe following sample demonstrates, in general, how to create a domain using one of the CreateDomain overloads.

// Set up the AppDomainSetup
AppDomainSetup^ setup = gcnew AppDomainSetup;
setup->ApplicationBase = "(some directory)";
setup->ConfigurationFile = "(some file)";

// Set up the Evidence
Evidence^ baseEvidence = AppDomain::CurrentDomain->Evidence;
Evidence^ evidence = gcnew Evidence( baseEvidence );
evidence->AddAssembly( "(some assembly)" );
evidence->AddHost( "(some host)" );

// Create the AppDomain
AppDomain^ newDomain = AppDomain::CreateDomain( "newDomain", evidence, setup );
// Set up the AppDomainSetup
AppDomainSetup setup = new AppDomainSetup();
setup.ApplicationBase = "(some directory)";
setup.ConfigurationFile = "(some file)";

// Set up the Evidence
Evidence baseEvidence = AppDomain.CurrentDomain.Evidence;
Evidence evidence = new Evidence(baseEvidence);
evidence.AddAssembly("(some assembly)");
evidence.AddHost("(some host)");

// Create the AppDomain
AppDomain newDomain = AppDomain.CreateDomain("newDomain", evidence, setup);
' Set up the AppDomainSetup
Dim setup As New AppDomainSetup()
setup.ApplicationBase = "(some directory)"
setup.ConfigurationFile = "(some file)"

' Set up the Evidence
Dim baseEvidence As Evidence = AppDomain.CurrentDomain.Evidence
Dim evidence As New Evidence(baseEvidence)
evidence.AddAssembly("(some assembly)")
evidence.AddHost("(some host)")

' Create the AppDomain
Dim newDomain As AppDomain = AppDomain.CreateDomain("newDomain", evidence, setup)

備註

如果 securityInfo 未提供,則會使用來自目前應用程式域的辨識項。If securityInfo is not supplied, the evidence from the current application domain is used.

如需陰影複製的詳細資訊,請參閱 ShadowCopyFiles陰影複製元件For more information about shadow copying, see ShadowCopyFiles and Shadow Copying Assemblies.

重要

請勿使用這個方法多載來建立沙箱應用程式域。Do not use this method overload to create sandboxed application domains. 從 .NET Framework 4 開始,提供的辨識項不再 securityInfo 影響應用程式域的授權集。Beginning with the .NET Framework 4, the evidence that is supplied for securityInfo no longer affects the grant set of the application domain. 您可以使用方法多載 CreateDomain(String, Evidence, AppDomainSetup, PermissionSet, StrongName[]) 來建立沙箱應用程式域。Use the CreateDomain(String, Evidence, AppDomainSetup, PermissionSet, StrongName[]) method overload to create sandboxed application domains.

適用於

CreateDomain(String, Evidence, AppDomainSetup, PermissionSet, StrongName[])

使用指定之名稱、辨識項、應用程式定義域設定資訊、預設權限集合及完全信任的組件陣列,建立新的應用程式定義域。Creates a new application domain using the specified name, evidence, application domain setup information, default permission set, and array of fully trusted assemblies.

public:
 static AppDomain ^ CreateDomain(System::String ^ friendlyName, System::Security::Policy::Evidence ^ securityInfo, AppDomainSetup ^ info, System::Security::PermissionSet ^ grantSet, ... cli::array <System::Security::Policy::StrongName ^> ^ fullTrustAssemblies);
public static AppDomain CreateDomain (string friendlyName, System.Security.Policy.Evidence securityInfo, AppDomainSetup info, System.Security.PermissionSet grantSet, params System.Security.Policy.StrongName[] fullTrustAssemblies);
static member CreateDomain : string * System.Security.Policy.Evidence * AppDomainSetup * System.Security.PermissionSet * System.Security.Policy.StrongName[] -> AppDomain
Public Shared Function CreateDomain (friendlyName As String, securityInfo As Evidence, info As AppDomainSetup, grantSet As PermissionSet, ParamArray fullTrustAssemblies As StrongName()) As AppDomain

參數

friendlyName
String

定義域的易記名稱。The friendly name of the domain. 這個易記名稱可以在使用者介面中顯示以識別該定義域。This friendly name can be displayed in user interfaces to identify the domain. 如需詳細資訊,請參閱 FriendlyName 的說明。For more information, see the description of FriendlyName.

securityInfo
Evidence

辨識項,可建立能在應用程式定義域內執行之程式碼的識別。Evidence that establishes the identity of the code that runs in the application domain. 傳遞 null 可使用目前應用程式定義域的辨識項。Pass null to use the evidence of the current application domain.

info
AppDomainSetup

物件,包含應用程式定義域初始化資訊。An object that contains application domain initialization information.

grantSet
PermissionSet

預設使用權限集合,其授與給載入無特定授權的新應用程式定義域中的所有組件。A default permission set that is granted to all assemblies loaded into the new application domain that do not have specific grants.

fullTrustAssemblies
StrongName[]

強式名稱的陣列,表示在新的應用程式定義域中視為完全信任的組件。An array of strong names representing assemblies to be considered fully trusted in the new application domain.

傳回

AppDomain

新建立的應用程式定義域。The newly created application domain.

例外狀況

friendlyNamenullfriendlyName is null.

應用程式定義域為 nullThe application domain is null.

-或--or- 未在提供給 infoApplicationBase 物件上設定 AppDomainSetup 屬性。The ApplicationBase property is not set on the AppDomainSetup object that is supplied for info.

備註

您必須設定所 ApplicationBase AppDomainSetup 提供物件的屬性 infoYou must set the ApplicationBase property of the AppDomainSetup object that you supply for info. 否則,會擲回例外狀況。Otherwise, an exception is thrown.

如果 securityInfo 未提供,則會使用來自目前應用程式域的辨識項。If securityInfo is not supplied, the evidence from the current application domain is used.

針對和提供的 grantSet 資訊 fullTrustAssemblies 是用來建立 ApplicationTrust 新應用程式域的物件。The information provided for grantSet and fullTrustAssemblies is used to create an ApplicationTrust object for the new application domain.

適用於

CreateDomain(String, Evidence)

使用提供的辨識項,建立具有指定名稱的新應用程式定義域。Creates a new application domain with the given name using the supplied evidence.

public:
 static AppDomain ^ CreateDomain(System::String ^ friendlyName, System::Security::Policy::Evidence ^ securityInfo);
public static AppDomain CreateDomain (string friendlyName, System.Security.Policy.Evidence securityInfo);
static member CreateDomain : string * System.Security.Policy.Evidence -> AppDomain
Public Shared Function CreateDomain (friendlyName As String, securityInfo As Evidence) As AppDomain

參數

friendlyName
String

定義域的易記名稱。The friendly name of the domain. 這個易記名稱可以在使用者介面中顯示以識別該定義域。This friendly name can be displayed in user interfaces to identify the domain. 如需詳細資訊,請參閱FriendlyNameFor more information, see FriendlyName.

securityInfo
Evidence

辨識項,可建立能在應用程式定義域內執行之程式碼的識別。Evidence that establishes the identity of the code that runs in the application domain. 傳遞 null 可使用目前應用程式定義域的辨識項。Pass null to use the evidence of the current application domain.

傳回

AppDomain

新建立的應用程式定義域。The newly created application domain.

例外狀況

friendlyNamenullfriendlyName is null.

範例

下列範例通常會示範如何使用其中一個多載來建立網域 CreateDomainThe following sample demonstrates, in general, how to create a domain using one of the CreateDomain overloads.

// Set up the AppDomainSetup
AppDomainSetup^ setup = gcnew AppDomainSetup;
setup->ApplicationBase = "(some directory)";
setup->ConfigurationFile = "(some file)";

// Set up the Evidence
Evidence^ baseEvidence = AppDomain::CurrentDomain->Evidence;
Evidence^ evidence = gcnew Evidence( baseEvidence );
evidence->AddAssembly( "(some assembly)" );
evidence->AddHost( "(some host)" );

// Create the AppDomain
AppDomain^ newDomain = AppDomain::CreateDomain( "newDomain", evidence, setup );
// Set up the AppDomainSetup
AppDomainSetup setup = new AppDomainSetup();
setup.ApplicationBase = "(some directory)";
setup.ConfigurationFile = "(some file)";

// Set up the Evidence
Evidence baseEvidence = AppDomain.CurrentDomain.Evidence;
Evidence evidence = new Evidence(baseEvidence);
evidence.AddAssembly("(some assembly)");
evidence.AddHost("(some host)");

// Create the AppDomain
AppDomain newDomain = AppDomain.CreateDomain("newDomain", evidence, setup);
' Set up the AppDomainSetup
Dim setup As New AppDomainSetup()
setup.ApplicationBase = "(some directory)"
setup.ConfigurationFile = "(some file)"

' Set up the Evidence
Dim baseEvidence As Evidence = AppDomain.CurrentDomain.Evidence
Dim evidence As New Evidence(baseEvidence)
evidence.AddAssembly("(some assembly)")
evidence.AddHost("(some host)")

' Create the AppDomain
Dim newDomain As AppDomain = AppDomain.CreateDomain("newDomain", evidence, setup)

備註

這個方法多載會使用 AppDomainSetup 預設應用程式域中的資訊。This method overload uses the AppDomainSetup information from the default application domain.

如果 securityInfo 未提供,則會使用來自目前應用程式域的辨識項。If securityInfo is not supplied, the evidence from the current application domain is used.

重要

請勿使用這個方法多載來建立沙箱應用程式域。Do not use this method overload to create sandboxed application domains. 從 .NET Framework 4 開始,提供的辨識項不再 securityInfo 影響應用程式域的授權集。Beginning with the .NET Framework 4, the evidence that is supplied for securityInfo no longer affects the grant set of the application domain. 您可以使用方法多載 CreateDomain(String, Evidence, AppDomainSetup, PermissionSet, StrongName[]) 來建立沙箱應用程式域。Use the CreateDomain(String, Evidence, AppDomainSetup, PermissionSet, StrongName[]) method overload to create sandboxed application domains.

適用於

CreateDomain(String)

建立具有指定名稱的新應用程式定義域。Creates a new application domain with the specified name.

public:
 static AppDomain ^ CreateDomain(System::String ^ friendlyName);
public static AppDomain CreateDomain (string friendlyName);
static member CreateDomain : string -> AppDomain
Public Shared Function CreateDomain (friendlyName As String) As AppDomain

參數

friendlyName
String

定義域的易記名稱。The friendly name of the domain.

傳回

AppDomain

新建立的應用程式定義域。The newly created application domain.

例外狀況

friendlyNamenullfriendlyName is null.

.NET Core 上不支援該方法。Method not supported on .NET Core.

範例

下列範例通常會示範如何使用其中一個多載來建立網域 CreateDomainThe following sample demonstrates, in general, how to create a domain using one of the CreateDomain overloads.

// Set up the AppDomainSetup
AppDomainSetup^ setup = gcnew AppDomainSetup;
setup->ApplicationBase = "(some directory)";
setup->ConfigurationFile = "(some file)";

// Set up the Evidence
Evidence^ baseEvidence = AppDomain::CurrentDomain->Evidence;
Evidence^ evidence = gcnew Evidence( baseEvidence );
evidence->AddAssembly( "(some assembly)" );
evidence->AddHost( "(some host)" );

// Create the AppDomain
AppDomain^ newDomain = AppDomain::CreateDomain( "newDomain", evidence, setup );
// Set up the AppDomainSetup
AppDomainSetup setup = new AppDomainSetup();
setup.ApplicationBase = "(some directory)";
setup.ConfigurationFile = "(some file)";

// Set up the Evidence
Evidence baseEvidence = AppDomain.CurrentDomain.Evidence;
Evidence evidence = new Evidence(baseEvidence);
evidence.AddAssembly("(some assembly)");
evidence.AddHost("(some host)");

// Create the AppDomain
AppDomain newDomain = AppDomain.CreateDomain("newDomain", evidence, setup);
' Set up the AppDomainSetup
Dim setup As New AppDomainSetup()
setup.ApplicationBase = "(some directory)"
setup.ConfigurationFile = "(some file)"

' Set up the Evidence
Dim baseEvidence As Evidence = AppDomain.CurrentDomain.Evidence
Dim evidence As New Evidence(baseEvidence)
evidence.AddAssembly("(some assembly)")
evidence.AddHost("(some host)")

' Create the AppDomain
Dim newDomain As AppDomain = AppDomain.CreateDomain("newDomain", evidence, setup)

備註

friendlyName參數的目的是要以對人類有意義的方式來識別網域。The friendlyName parameter is intended to identify the domain in a manner that is meaningful to humans. 此字串應該適用于在使用者介面中顯示。This string should be suitable for display in user interfaces.

這個方法多載會使用 AppDomainSetup 預設應用程式域中的資訊。This method overload uses the AppDomainSetup information from the default application domain.

另請參閱

適用於

CreateDomain(String, Evidence, AppDomainSetup)

使用指定名稱、辨識項和應用程式定義域安裝資訊,建立新的應用程式定義域。Creates a new application domain using the specified name, evidence, and application domain setup information.

public:
 static AppDomain ^ CreateDomain(System::String ^ friendlyName, System::Security::Policy::Evidence ^ securityInfo, AppDomainSetup ^ info);
public static AppDomain CreateDomain (string friendlyName, System.Security.Policy.Evidence securityInfo, AppDomainSetup info);
static member CreateDomain : string * System.Security.Policy.Evidence * AppDomainSetup -> AppDomain
Public Shared Function CreateDomain (friendlyName As String, securityInfo As Evidence, info As AppDomainSetup) As AppDomain

參數

friendlyName
String

定義域的易記名稱。The friendly name of the domain. 這個易記名稱可以在使用者介面中顯示以識別該定義域。This friendly name can be displayed in user interfaces to identify the domain. 如需詳細資訊,請參閱FriendlyNameFor more information, see FriendlyName.

securityInfo
Evidence

辨識項,可建立能在應用程式定義域內執行之程式碼的識別。Evidence that establishes the identity of the code that runs in the application domain. 傳遞 null 可使用目前應用程式定義域的辨識項。Pass null to use the evidence of the current application domain.

info
AppDomainSetup

物件,包含應用程式定義域初始化資訊。An object that contains application domain initialization information.

傳回

AppDomain

新建立的應用程式定義域。The newly created application domain.

例外狀況

friendlyNamenullfriendlyName is null.

範例

下列範例通常會示範如何使用其中一個多載來建立網域 CreateDomainThe following sample demonstrates, in general, how to create a domain using one of the CreateDomain overloads.

// Set up the AppDomainSetup
AppDomainSetup^ setup = gcnew AppDomainSetup;
setup->ApplicationBase = "(some directory)";
setup->ConfigurationFile = "(some file)";

// Set up the Evidence
Evidence^ baseEvidence = AppDomain::CurrentDomain->Evidence;
Evidence^ evidence = gcnew Evidence( baseEvidence );
evidence->AddAssembly( "(some assembly)" );
evidence->AddHost( "(some host)" );

// Create the AppDomain
AppDomain^ newDomain = AppDomain::CreateDomain( "newDomain", evidence, setup );
// Set up the AppDomainSetup
AppDomainSetup setup = new AppDomainSetup();
setup.ApplicationBase = "(some directory)";
setup.ConfigurationFile = "(some file)";

// Set up the Evidence
Evidence baseEvidence = AppDomain.CurrentDomain.Evidence;
Evidence evidence = new Evidence(baseEvidence);
evidence.AddAssembly("(some assembly)");
evidence.AddHost("(some host)");

// Create the AppDomain
AppDomain newDomain = AppDomain.CreateDomain("newDomain", evidence, setup);
' Set up the AppDomainSetup
Dim setup As New AppDomainSetup()
setup.ApplicationBase = "(some directory)"
setup.ConfigurationFile = "(some file)"

' Set up the Evidence
Dim baseEvidence As Evidence = AppDomain.CurrentDomain.Evidence
Dim evidence As New Evidence(baseEvidence)
evidence.AddAssembly("(some assembly)")
evidence.AddHost("(some host)")

' Create the AppDomain
Dim newDomain As AppDomain = AppDomain.CreateDomain("newDomain", evidence, setup)

備註

如果 info 未提供,這個方法多載會使用 AppDomainSetup 預設應用程式域中的資訊。If info is not supplied, this method overload uses the AppDomainSetup information from the default application domain.

如果 securityInfo 未提供,則會使用來自目前應用程式域的辨識項。If securityInfo is not supplied, the evidence from the current application domain is used.

重要

請勿使用這個方法多載來建立沙箱應用程式域。Do not use this method overload to create sandboxed application domains. 從 .NET Framework 4 開始,提供的辨識項不再 securityInfo 影響應用程式域的授權集。Beginning with the .NET Framework 4, the evidence that is supplied for securityInfo no longer affects the grant set of the application domain. 您可以使用方法多載 CreateDomain(String, Evidence, AppDomainSetup, PermissionSet, StrongName[]) 來建立沙箱應用程式域。Use the CreateDomain(String, Evidence, AppDomainSetup, PermissionSet, StrongName[]) method overload to create sandboxed application domains.

適用於