Creates a new application domain.
Overloads 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)Obsolete.
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
Parameters
The friendly name of the domain. This friendly name can be displayed in user interfaces to identify the domain. For more information, see FriendlyName.
Evidence that establishes the identity of the code that runs in the application domain. Pass null
to use the evidence of the current application domain.
The base directory that the assembly resolver uses to probe for assemblies. For more information, see BaseDirectory.
The path relative to the base directory where the assembly resolver should probe for private assemblies. For more information, see RelativeSearchPath.
true
to load a shadow copy of an assembly into the application domain.
An array of string arguments to be passed to the callback represented by adInit
, when the new AppDomain object is initialized.
The newly created application domain.
Exceptions RemarksThe method represented by adInit
is executed in the context of the newly created application domain.
If securityInfo
is not supplied, the evidence from the current application domain is used.
For more information about shadow copying, see ShadowCopyFiles and Shadow Copying Assemblies.
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
Parameters
The friendly name of the domain. This friendly name can be displayed in user interfaces to identify the domain. For more information, see FriendlyName.
Evidence that establishes the identity of the code that runs in the application domain. Pass null
to use the evidence of the current application domain.
The base directory that the assembly resolver uses to probe for assemblies. For more information, see BaseDirectory.
The path relative to the base directory where the assembly resolver should probe for private assemblies. For more information, see RelativeSearchPath.
If true
, a shadow copy of an assembly is loaded into this application domain.
The newly created application domain.
Exceptions ExamplesThe 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);
open System
open System.Security.Policy
// Set up the AppDomainSetup
let setup = AppDomainSetup()
setup.ApplicationBase <- "(some directory)"
setup.ConfigurationFile <- "(some file)"
// Set up the Evidence
let baseEvidence = AppDomain.CurrentDomain.Evidence
let evidence = Evidence baseEvidence
evidence.AddAssembly "(some assembly)"
evidence.AddHost "(some host)"
// Create the AppDomain
let 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)
Remarks
If securityInfo
is not supplied, the evidence from the current application domain is used.
For more information about shadow copying, see ShadowCopyFiles and Shadow Copying Assemblies.
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
Parameters
The friendly name of the domain. This friendly name can be displayed in user interfaces to identify the domain. For more information, see the description of FriendlyName.
Evidence that establishes the identity of the code that runs in the application domain. Pass null
to use the evidence of the current application domain.
An object that contains application domain initialization information.
A default permission set that is granted to all assemblies loaded into the new application domain that do not have specific grants.
An array of strong names representing assemblies to be considered fully trusted in the new application domain.
ReturnsThe newly created application domain.
Exceptions RemarksYou must set the ApplicationBase property of the AppDomainSetup object that you supply for info
. Otherwise, an exception is thrown.
If securityInfo
is not supplied, the evidence from the current application domain is used.
The information provided for grantSet
and fullTrustAssemblies
is used to create an ApplicationTrust object for the new application domain.
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
Parameters
The friendly name of the domain. This friendly name can be displayed in user interfaces to identify the domain. For more information, see FriendlyName.
Evidence that establishes the identity of the code that runs in the application domain. Pass null
to use the evidence of the current application domain.
The newly created application domain.
Exceptions ExamplesThe 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);
open System
open System.Security.Policy
// Set up the AppDomainSetup
let setup = AppDomainSetup()
setup.ApplicationBase <- "(some directory)"
setup.ConfigurationFile <- "(some file)"
// Set up the Evidence
let baseEvidence = AppDomain.CurrentDomain.Evidence
let evidence = Evidence baseEvidence
evidence.AddAssembly "(some assembly)"
evidence.AddHost "(some host)"
// Create the AppDomain
let 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)
Remarks
This method overload uses the AppDomainSetup information from the default application domain.
If securityInfo
is not supplied, the evidence from the current application domain is used.
Caution
Creating and unloading AppDomains is not supported and throws an exception.
Creates a new application domain with the specified name.
public:
static AppDomain ^ CreateDomain(System::String ^ friendlyName);
[System.Obsolete("Creating and unloading AppDomains is not supported and throws an exception.", DiagnosticId="SYSLIB0024", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static AppDomain CreateDomain(string friendlyName);
public static AppDomain CreateDomain(string friendlyName);
[<System.Obsolete("Creating and unloading AppDomains is not supported and throws an exception.", DiagnosticId="SYSLIB0024", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member CreateDomain : string -> AppDomain
static member CreateDomain : string -> AppDomain
Public Shared Function CreateDomain (friendlyName As String) As AppDomain
Parameters
The friendly name of the domain.
ReturnsThe newly created application domain.
.NET Core and .NET 5+ only: In all cases.
ExamplesThe 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);
open System
open System.Security.Policy
// Set up the AppDomainSetup
let setup = AppDomainSetup()
setup.ApplicationBase <- "(some directory)"
setup.ConfigurationFile <- "(some file)"
// Set up the Evidence
let baseEvidence = AppDomain.CurrentDomain.Evidence
let evidence = Evidence baseEvidence
evidence.AddAssembly "(some assembly)"
evidence.AddHost "(some host)"
// Create the AppDomain
let 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)
Remarks
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.
This method overload uses the AppDomainSetup information from the default application domain.
See also 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
Parameters
The friendly name of the domain. This friendly name can be displayed in user interfaces to identify the domain. For more information, see FriendlyName.
Evidence that establishes the identity of the code that runs in the application domain. Pass null
to use the evidence of the current application domain.
An object that contains application domain initialization information.
ReturnsThe newly created application domain.
Exceptions ExamplesThe 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);
open System
open System.Security.Policy
// Set up the AppDomainSetup
let setup = AppDomainSetup()
setup.ApplicationBase <- "(some directory)"
setup.ConfigurationFile <- "(some file)"
// Set up the Evidence
let baseEvidence = AppDomain.CurrentDomain.Evidence
let evidence = Evidence baseEvidence
evidence.AddAssembly "(some assembly)"
evidence.AddHost "(some host)"
// Create the AppDomain
let 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)
Remarks
If info
is not supplied, this method overload uses the AppDomainSetup information from the default application domain.
If securityInfo
is not supplied, the evidence from the current application domain is used.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4