mscorlib(4.0.0.0) API with additions
System.AppDomain Class Reference

Represents an application domain, which is an isolated environment where applications execute. This class cannot be inherited. More...

Inheritance diagram for System.AppDomain:
[legend]
Collaboration diagram for System.AppDomain:
[legend]

Public Member Functions

AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access)
 Defines a dynamic assembly with the specified name and access mode. More...
 
AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, IEnumerable< CustomAttributeBuilder > assemblyAttributes)
 Defines a dynamic assembly with the specified name, access mode, and custom attributes. More...
 
AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, IEnumerable< CustomAttributeBuilder > assemblyAttributes, SecurityContextSource securityContextSource)
 Defines a dynamic assembly with the specified name, access mode, and custom attributes, and using the specified source for its security context. More...
 
AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir)
 Defines a dynamic assembly using the specified name, access mode, and storage directory. More...
 
AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, Evidence evidence)
 Defines a dynamic assembly using the specified name, access mode, and evidence. More...
 
AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions)
 Defines a dynamic assembly using the specified name, access mode, and permission requests. More...
 
AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir, Evidence evidence)
 Defines a dynamic assembly using the specified name, access mode, storage directory, and evidence. More...
 
AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions)
 Defines a dynamic assembly using the specified name, access mode, storage directory, and permission requests. More...
 
AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions)
 Defines a dynamic assembly using the specified name, access mode, evidence, and permission requests. More...
 
AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions)
 Defines a dynamic assembly using the specified name, access mode, storage directory, evidence, and permission requests. More...
 
AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, bool isSynchronized)
 Defines a dynamic assembly using the specified name, access mode, storage directory, evidence, permission requests, and synchronization option. More...
 
AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, bool isSynchronized, IEnumerable< CustomAttributeBuilder > assemblyAttributes)
 Defines a dynamic assembly with the specified name, access mode, storage directory, evidence, permission requests, synchronization option, and custom attributes. More...
 
AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir, bool isSynchronized, IEnumerable< CustomAttributeBuilder > assemblyAttributes)
 Defines a dynamic assembly using the specified name, access mode, storage directory, and synchronization option. More...
 
string ApplyPolicy (string assemblyName)
 Returns the assembly display name after policy has been applied. More...
 
ObjectHandle CreateInstance (string assemblyName, string typeName)
 Creates a new instance of the specified type defined in the specified assembly. More...
 
ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName)
 Creates a new instance of the specified type defined in the specified assembly file. More...
 
ObjectHandle CreateComInstanceFrom (string assemblyName, string typeName)
 Creates a new instance of a specified COM type. Parameters specify the name of a file that contains an assembly containing the type and the name of the type. More...
 
ObjectHandle CreateComInstanceFrom (string assemblyFile, string typeName, byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
 Creates a new instance of a specified COM type. Parameters specify the name of a file that contains an assembly containing the type and the name of the type. More...
 
ObjectHandle CreateInstance (string assemblyName, string typeName, object[] activationAttributes)
 Creates a new instance of the specified type defined in the specified assembly. A parameter specifies an array of activation attributes. More...
 
ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, object[] activationAttributes)
 Creates a new instance of the specified type defined in the specified assembly file. More...
 
ObjectHandle CreateInstance (string assemblyName, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes, Evidence securityAttributes)
 Creates a new instance of the specified type defined in the specified assembly. Parameters specify a binder, binding flags, constructor arguments, culture-specific information used to interpret arguments, activation attributes, and authorization to create the type. More...
 
ObjectHandle CreateInstance (string assemblyName, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes)
 Creates a new instance of the specified type defined in the specified assembly. Parameters specify a binder, binding flags, constructor arguments, culture-specific information used to interpret arguments, and optional activation attributes. More...
 
ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes, Evidence securityAttributes)
 Creates a new instance of the specified type defined in the specified assembly file. More...
 
ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes)
 Creates a new instance of the specified type defined in the specified assembly file. More...
 
Assembly Load (AssemblyName assemblyRef)
 Loads an T:System.Reflection.Assembly given its T:System.Reflection.AssemblyName. More...
 
Assembly Load (string assemblyString)
 Loads an T:System.Reflection.Assembly given its display name. More...
 
Assembly Load (byte[] rawAssembly)
 Loads the T:System.Reflection.Assembly with a common object file format (COFF) based image containing an emitted T:System.Reflection.Assembly. More...
 
Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore)
 Loads the T:System.Reflection.Assembly with a common object file format (COFF) based image containing an emitted T:System.Reflection.Assembly. The raw bytes representing the symbols for the T:System.Reflection.Assembly are also loaded. More...
 
Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore, Evidence securityEvidence)
 Loads the T:System.Reflection.Assembly with a common object file format (COFF) based image containing an emitted T:System.Reflection.Assembly. The raw bytes representing the symbols for the T:System.Reflection.Assembly are also loaded. More...
 
Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity)
 Loads an T:System.Reflection.Assembly given its T:System.Reflection.AssemblyName. More...
 
Assembly Load (string assemblyString, Evidence assemblySecurity)
 Loads an T:System.Reflection.Assembly given its display name. More...
 
int ExecuteAssembly (string assemblyFile)
 Executes the assembly contained in the specified file. More...
 
int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity)
 Executes the assembly contained in the specified file, using the specified evidence. More...
 
int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity, string[] args)
 Executes the assembly contained in the specified file, using the specified evidence and arguments. More...
 
int ExecuteAssembly (string assemblyFile, string[] args)
 Executes the assembly contained in the specified file, using the specified arguments. More...
 
int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity, string[] args, byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
 Executes the assembly contained in the specified file, using the specified evidence, arguments, hash value, and hash algorithm. More...
 
int ExecuteAssembly (string assemblyFile, string[] args, byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
 Executes the assembly contained in the specified file, using the specified arguments, hash value, and hash algorithm. More...
 
int ExecuteAssemblyByName (string assemblyName)
 Executes an assembly given its display name. More...
 
int ExecuteAssemblyByName (string assemblyName, Evidence assemblySecurity)
 Executes an assembly given its display name, using the specified evidence. More...
 
int ExecuteAssemblyByName (string assemblyName, Evidence assemblySecurity, params string[] args)
 Executes the assembly given its display name, using the specified evidence and arguments. More...
 
int ExecuteAssemblyByName (string assemblyName, params string[] args)
 Executes the assembly given its display name, using the specified arguments. More...
 
int ExecuteAssemblyByName (AssemblyName assemblyName, Evidence assemblySecurity, params string[] args)
 Executes the assembly given an T:System.Reflection.AssemblyName, using the specified evidence and arguments. More...
 
int ExecuteAssemblyByName (AssemblyName assemblyName, params string[] args)
 Executes the assembly given an T:System.Reflection.AssemblyName, using the specified arguments. More...
 
override string ToString ()
 Obtains a string representation that includes the friendly name of the application domain and any context policies. More...
 
Assembly [] GetAssemblies ()
 Gets the assemblies that have been loaded into the execution context of this application domain. More...
 
Assembly [] ReflectionOnlyGetAssemblies ()
 Returns the assemblies that have been loaded into the reflection-only context of the application domain. More...
 
bool IsFinalizingForUnload ()
 Indicates whether this application domain is unloading, and the objects it contains are being finalized by the common language runtime. More...
 
void AppendPrivatePath (string path)
 Appends the specified directory name to the private path list. More...
 
void ClearPrivatePath ()
 Resets the path that specifies the location of private assemblies to the empty string (""). More...
 
void ClearShadowCopyPath ()
 Resets the list of directories containing shadow copied assemblies to the empty string (""). More...
 
void SetCachePath (string path)
 Establishes the specified directory path as the location where assemblies are shadow copied. More...
 
void SetData (string name, object data)
 Assigns the specified value to the specified application domain property. More...
 
void SetData (string name, object data, IPermission permission)
 Assigns the specified value to the specified application domain property, with a specified permission to demand of the caller when the property is retrieved. More...
 
object GetData (string name)
 Gets the value stored in the current application domain for the specified name. More...
 
bool? IsCompatibilitySwitchSet (string value)
 Gets a nullable Boolean value that indicates whether any compatibility switches are set, and if so, whether the specified compatibility switch is set. More...
 
static int GetCurrentThreadId ()
 Gets the current thread identifier. More...
 
void SetAppDomainPolicy (PolicyLevel domainPolicy)
 Establishes the security policy level for this application domain. More...
 
void SetThreadPrincipal (IPrincipal principal)
 Sets the default principal object to be attached to threads if they attempt to bind to a principal while executing in this application domain. More...
 
void SetPrincipalPolicy (PrincipalPolicy policy)
 Specifies how principal and identity objects should be attached to a thread if the thread attempts to bind to a principal while executing in this application domain. More...
 
override object InitializeLifetimeService ()
 Gives the T:System.AppDomain an infinite lifetime by preventing a lease from being created. More...
 
void DoCallBack (CrossAppDomainDelegate callBackDelegate)
 Executes the code in another application domain that is identified by the specified delegate. More...
 
void SetShadowCopyPath (string path)
 Establishes the specified directory path as the location of assemblies to be shadow copied. More...
 
void SetShadowCopyFiles ()
 Turns on shadow copying. More...
 
void SetDynamicBase (string path)
 Establishes the specified directory path as the base directory for subdirectories where dynamically generated files are stored and accessed. More...
 
object CreateInstanceAndUnwrap (string assemblyName, string typeName)
 Creates a new instance of the specified type. Parameters specify the assembly where the type is defined, and the name of the type. More...
 
object CreateInstanceAndUnwrap (string assemblyName, string typeName, object[] activationAttributes)
 Creates a new instance of the specified type. Parameters specify the assembly where the type is defined, the name of the type, and an array of activation attributes. More...
 
object CreateInstanceAndUnwrap (string assemblyName, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes, Evidence securityAttributes)
 Creates a new instance of the specified type. Parameters specify the name of the type, and how it is found and created. More...
 
object CreateInstanceAndUnwrap (string assemblyName, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes)
 Creates a new instance of the specified type defined in the specified assembly, specifying whether the case of the type name is ignored; the binding attributes and the binder that are used to select the type to be created; the arguments of the constructor; the culture; and the activation attributes. More...
 
object CreateInstanceFromAndUnwrap (string assemblyName, string typeName)
 Creates a new instance of the specified type defined in the specified assembly file. More...
 
object CreateInstanceFromAndUnwrap (string assemblyName, string typeName, object[] activationAttributes)
 Creates a new instance of the specified type defined in the specified assembly file. More...
 
object CreateInstanceFromAndUnwrap (string assemblyName, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes, Evidence securityAttributes)
 Creates a new instance of the specified type defined in the specified assembly file. More...
 
object CreateInstanceFromAndUnwrap (string assemblyFile, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes)
 Creates a new instance of the specified type defined in the specified assembly file, specifying whether the case of the type name is ignored; the binding attributes and the binder that are used to select the type to be created; the arguments of the constructor; the culture; and the activation attributes. More...
 
bool IsDefaultAppDomain ()
 Returns a value that indicates whether the application domain is the default application domain for the process. More...
 
new Type GetType ()
 Gets the type of the current instance. More...
 
- Public Member Functions inherited from System.MarshalByRefObject
object GetLifetimeService ()
 Retrieves the current lifetime service object that controls the lifetime policy for this instance. More...
 
virtual ObjRef CreateObjRef (Type requestedType)
 Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. More...
 
- Public Member Functions inherited from System._AppDomain
new bool Equals (object other)
 Provides COM objects with version-independent access to the inherited M:System.Object.Equals(System.Object) method. More...
 
new int GetHashCode ()
 Provides COM objects with version-independent access to the inherited M:System.Object.GetHashCode method. More...
 
object GetLifetimeService ()
 Provides COM objects with version-independent access to the inherited M:System.MarshalByRefObject.GetLifetimeService method. More...
 

Static Public Member Functions

static void Unload (AppDomain domain)
 Unloads the specified application domain. More...
 
static AppDomain CreateDomain (string friendlyName, Evidence securityInfo)
 Creates a new application domain with the given name using the supplied evidence. More...
 
static AppDomain CreateDomain (string friendlyName, Evidence securityInfo, string appBasePath, string appRelativeSearchPath, bool shadowCopyFiles)
 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. More...
 
static AppDomain CreateDomain (string friendlyName)
 Creates a new application domain with the specified name. More...
 
static AppDomain CreateDomain (string friendlyName, Evidence securityInfo, AppDomainSetup info)
 Creates a new application domain using the specified name, evidence, and application domain setup information. More...
 
static AppDomain CreateDomain (string friendlyName, Evidence securityInfo, AppDomainSetup info, PermissionSet grantSet, params StrongName[] fullTrustAssemblies)
 Creates a new application domain using the specified name, evidence, application domain setup information, default permission set, and array of fully trusted assemblies. More...
 
static AppDomain CreateDomain (string friendlyName, Evidence securityInfo, string appBasePath, string appRelativeSearchPath, bool shadowCopyFiles, AppDomainInitializer adInit, string[] adInitArgs)
 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. More...
 

Public Attributes

string BaseDirectory => FusionStore.ApplicationBase
 Gets the base directory that the assembly resolver uses to probe for assemblies. More...
 
string RelativeSearchPath => FusionStore.PrivateBinPath
 Gets the path under the base directory where the assembly resolver should probe for private assemblies. More...
 
AppDomainSetup SetupInformation => new AppDomainSetup(FusionStore, copyDomainBoundData: true)
 Gets the application domain configuration information for this instance. More...
 

Static Public Attributes

static AppDomain CurrentDomain => Thread.GetDomain()
 Gets the current application domain for the current T:System.Threading.Thread. More...
 

Properties

AppDomainManager DomainManager [get]
 Gets the domain manager that was provided by the host when the application domain was initialized. More...
 
Evidence Evidence [get]
 Gets the T:System.Security.Policy.Evidence associated with this application domain. More...
 
string FriendlyName [get]
 Gets the friendly name of this application domain. More...
 
bool ShadowCopyFiles [get]
 Gets an indication whether the application domain is configured to shadow copy files. More...
 
ActivationContext ActivationContext [get]
 Gets the activation context for the current application domain. More...
 
ApplicationIdentity ApplicationIdentity [get]
 Gets the identity of the application in the application domain. More...
 
ApplicationTrust ApplicationTrust [get]
 Gets information describing permissions granted to an application and whether the application has a trust level that allows it to run. More...
 
string DynamicDirectory [get]
 Gets the directory that the assembly resolver uses to probe for dynamically created assemblies. More...
 
PermissionSet PermissionSet [get]
 Gets the permission set of a sandboxed application domain. More...
 
bool??? IsFullyTrusted [get]
 Gets a value that indicates whether assemblies that are loaded into the current application domain execute with full trust. More...
 
bool IsHomogenous [get]
 Gets a value that indicates whether the current application domain has a set of permissions that is granted to all assemblies that are loaded into the application domain. More...
 
int Id [get]
 Gets an integer that uniquely identifies the application domain within the process. More...
 
static bool MonitoringIsEnabled [get, set]
 Gets or sets a value that indicates whether CPU and memory monitoring of application domains is enabled for the current process. Once monitoring is enabled for a process, it cannot be disabled. More...
 
TimeSpan MonitoringTotalProcessorTime [get]
 Gets the total processor time that has been used by all threads while executing in the current application domain, since the process started. More...
 
long MonitoringTotalAllocatedMemorySize [get]
 Gets the total size, in bytes, of all memory allocations that have been made by the application domain since it was created, without subtracting memory that has been collected. More...
 
long MonitoringSurvivedMemorySize [get]
 Gets the number of bytes that survived the last collection and that are known to be referenced by the current application domain. More...
 
static long MonitoringSurvivedProcessMemorySize [get]
 Gets the total bytes that survived from the last collection for all application domains in the process. More...
 
ResolveEventHandler TypeResolve
 Occurs when the resolution of a type fails. More...
 
ResolveEventHandler ResourceResolve
 Occurs when the resolution of a resource fails because the resource is not a valid linked or embedded resource in the assembly. More...
 
ResolveEventHandler AssemblyResolve
 Occurs when the resolution of an assembly fails. More...
 
EventHandler ProcessExit
 Occurs when the default application domain's parent process exits. More...
 
EventHandler DomainUnload
 Occurs when an T:System.AppDomain is about to be unloaded. More...
 
UnhandledExceptionEventHandler UnhandledException
 Occurs when an exception is not caught. More...
 
EventHandler< FirstChanceExceptionEventArgsFirstChanceException
 Occurs when an exception is thrown in managed code, before the runtime searches the call stack for an exception handler in the application domain. More...
 
- Properties inherited from System._AppDomain
Evidence Evidence [get]
 Provides COM objects with version-independent access to the P:System.AppDomain.Evidence property. More...
 
string FriendlyName [get]
 Provides COM objects with version-independent access to the P:System.AppDomain.FriendlyName property. More...
 
string BaseDirectory [get]
 Provides COM objects with version-independent access to the P:System.AppDomain.BaseDirectory property. More...
 
string RelativeSearchPath [get]
 Provides COM objects with version-independent access to the P:System.AppDomain.RelativeSearchPath property. More...
 
bool ShadowCopyFiles [get]
 Provides COM objects with version-independent access to the P:System.AppDomain.ShadowCopyFiles property. More...
 
string DynamicDirectory [get]
 Provides COM objects with version-independent access to the P:System.AppDomain.DynamicDirectory property. More...
 
- Properties inherited from System.Security.IEvidenceFactory
Evidence Evidence [get]
 Gets T:System.Security.Policy.Evidence that verifies the current object's identity. More...
 

Events

AssemblyLoadEventHandler AssemblyLoad
 Occurs when an assembly is loaded. More...
 
ResolveEventHandler ReflectionOnlyAssemblyResolve
 Occurs when the resolution of an assembly fails in the reflection-only context. More...
 
- Events inherited from System._AppDomain
EventHandler DomainUnload
 Provides COM objects with version-independent access to the E:System.AppDomain.DomainUnload event. More...
 
AssemblyLoadEventHandler AssemblyLoad
 Provides COM objects with version-independent access to the E:System.AppDomain.AssemblyLoad event. More...
 
EventHandler ProcessExit
 Provides COM objects with version-independent access to the E:System.AppDomain.ProcessExit event. More...
 
ResolveEventHandler TypeResolve
 Provides COM objects with version-independent access to the E:System.AppDomain.TypeResolve event. More...
 
ResolveEventHandler ResourceResolve
 Provides COM objects with version-independent access to the E:System.AppDomain.ResourceResolve event. More...
 
ResolveEventHandler AssemblyResolve
 Provides COM objects with version-independent access to the E:System.AppDomain.AssemblyResolve event. More...
 
UnhandledExceptionEventHandler UnhandledException
 Provides COM objects with version-independent access to the E:System.AppDomain.UnhandledException event. More...
 

Additional Inherited Members

- Protected Member Functions inherited from System.MarshalByRefObject
MarshalByRefObject MemberwiseClone (bool cloneIdentity)
 Creates a shallow copy of the current T:System.MarshalByRefObject object. More...
 

Detailed Description

Represents an application domain, which is an isolated environment where applications execute. This class cannot be inherited.

Definition at line 33 of file AppDomain.cs.

Member Function Documentation

◆ AppendPrivatePath()

void System.AppDomain.AppendPrivatePath ( string  path)

Appends the specified directory name to the private path list.

Parameters
pathThe name of the directory to be appended to the private path.
Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Implements System._AppDomain.

Definition at line 2362 of file AppDomain.cs.

◆ ApplyPolicy()

string System.AppDomain.ApplyPolicy ( string  assemblyName)

Returns the assembly display name after policy has been applied.

Parameters
assemblyNameThe assembly display name, in the form provided by the P:System.Reflection.Assembly.FullName property.
Returns
A string containing the assembly display name after policy has been applied.

Definition at line 1472 of file AppDomain.cs.

◆ ClearPrivatePath()

void System.AppDomain.ClearPrivatePath ( )

Resets the path that specifies the location of private assemblies to the empty string ("").

Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Implements System._AppDomain.

Definition at line 2387 of file AppDomain.cs.

◆ ClearShadowCopyPath()

void System.AppDomain.ClearShadowCopyPath ( )

Resets the list of directories containing shadow copied assemblies to the empty string ("").

Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Implements System._AppDomain.

Definition at line 2396 of file AppDomain.cs.

◆ CreateComInstanceFrom() [1/2]

ObjectHandle System.AppDomain.CreateComInstanceFrom ( string  assemblyName,
string  typeName 
)

Creates a new instance of a specified COM type. Parameters specify the name of a file that contains an assembly containing the type and the name of the type.

Parameters
assemblyNameThe name of a file containing an assembly that defines the requested type.
typeNameThe name of the requested type.
Returns
An object that is a wrapper for the new instance specified by typeName . The return value needs to be unwrapped to access the real object.
Exceptions
T:System.ArgumentNullExceptionassemblyName or typeName is null.
T:System.TypeLoadExceptionThe type cannot be loaded.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.MissingMethodExceptionNo public parameterless constructor was found.
T:System.IO.FileNotFoundExceptionassemblyName is not found.
T:System.MemberAccessExceptiontypeName is an abstract class. -or-This member was invoked with a late-binding mechanism.
T:System.NotSupportedExceptionThe caller cannot provide activation attributes for an object that does not inherit from T:System.MarshalByRefObject.
T:System.ArgumentExceptionassemblyName is an empty string ("").
T:System.BadImageFormatExceptionassemblyName is not a valid assembly.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.
T:System.NullReferenceExceptionThe COM object that is being referred to is null.

Definition at line 1578 of file AppDomain.cs.

◆ CreateComInstanceFrom() [2/2]

ObjectHandle System.AppDomain.CreateComInstanceFrom ( string  assemblyFile,
string  typeName,
byte []  hashValue,
AssemblyHashAlgorithm  hashAlgorithm 
)

Creates a new instance of a specified COM type. Parameters specify the name of a file that contains an assembly containing the type and the name of the type.

Parameters
assemblyFileThe name of a file containing an assembly that defines the requested type.
typeNameThe name of the requested type.
hashValueRepresents the value of the computed hash code.
hashAlgorithmRepresents the hash algorithm used by the assembly manifest.
Returns
An object that is a wrapper for the new instance specified by typeName . The return value needs to be unwrapped to access the real object.
Exceptions
T:System.ArgumentNullExceptionassemblyName or typeName is null.
T:System.TypeLoadExceptionThe type cannot be loaded.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.MissingMethodExceptionNo public parameterless constructor was found.
T:System.IO.FileNotFoundExceptionassemblyFile is not found.
T:System.MemberAccessExceptiontypeName is an abstract class. -or-This member was invoked with a late-binding mechanism.
T:System.NotSupportedExceptionThe caller cannot provide activation attributes for an object that does not inherit from T:System.MarshalByRefObject.
T:System.ArgumentExceptionassemblyFile is the empty string ("").
T:System.BadImageFormatExceptionassemblyFile is not a valid assembly.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.
T:System.NullReferenceExceptionThe COM object that is being referred to is null.

Definition at line 1609 of file AppDomain.cs.

◆ CreateDomain() [1/6]

static AppDomain System.AppDomain.CreateDomain ( string  friendlyName,
Evidence  securityInfo 
)
static

Creates a new application domain with the given name using the supplied evidence.

Parameters
friendlyNameThe friendly name of the domain. This friendly name can be displayed in user interfaces to identify the domain. For more information, see P:System.AppDomain.FriendlyName.
securityInfoEvidence that establishes the identity of the code that runs in the application domain. Pass null to use the evidence of the current application domain.
Returns
The newly created application domain.
Exceptions
T:System.ArgumentNullExceptionfriendlyName is null.

Definition at line 2747 of file AppDomain.cs.

◆ CreateDomain() [2/6]

static AppDomain System.AppDomain.CreateDomain ( string  friendlyName,
Evidence  securityInfo,
string  appBasePath,
string  appRelativeSearchPath,
bool  shadowCopyFiles 
)
static

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.

Parameters
friendlyNameThe friendly name of the domain. This friendly name can be displayed in user interfaces to identify the domain. For more information, see P:System.AppDomain.FriendlyName.
securityInfoEvidence that establishes the identity of the code that runs in the application domain. Pass null to use the evidence of the current application domain.
appBasePathThe base directory that the assembly resolver uses to probe for assemblies. For more information, see P:System.AppDomain.BaseDirectory.
appRelativeSearchPathThe path relative to the base directory where the assembly resolver should probe for private assemblies. For more information, see P:System.AppDomain.RelativeSearchPath.
shadowCopyFilesIf true, a shadow copy of an assembly is loaded into this application domain.
Returns
The newly created application domain.
Exceptions
T:System.ArgumentNullExceptionfriendlyName is null.

Definition at line 2761 of file AppDomain.cs.

◆ CreateDomain() [3/6]

static AppDomain System.AppDomain.CreateDomain ( string  friendlyName)
static

Creates a new application domain with the specified name.

Parameters
friendlyNameThe friendly name of the domain.
Returns
The newly created application domain.
Exceptions
T:System.ArgumentNullExceptionfriendlyName is null.

Definition at line 2782 of file AppDomain.cs.

◆ CreateDomain() [4/6]

static AppDomain System.AppDomain.CreateDomain ( string  friendlyName,
Evidence  securityInfo,
AppDomainSetup  info 
)
static

Creates a new application domain using the specified name, evidence, and application domain setup information.

Parameters
friendlyNameThe friendly name of the domain. This friendly name can be displayed in user interfaces to identify the domain. For more information, see P:System.AppDomain.FriendlyName.
securityInfoEvidence that establishes the identity of the code that runs in the application domain. Pass null to use the evidence of the current application domain.
infoAn object that contains application domain initialization information.
Returns
The newly created application domain.
Exceptions
T:System.ArgumentNullExceptionfriendlyName is null.

Definition at line 3152 of file AppDomain.cs.

◆ CreateDomain() [5/6]

static AppDomain System.AppDomain.CreateDomain ( string  friendlyName,
Evidence  securityInfo,
AppDomainSetup  info,
PermissionSet  grantSet,
params StrongName []  fullTrustAssemblies 
)
static

Creates a new application domain using the specified name, evidence, application domain setup information, default permission set, and array of fully trusted assemblies.

Parameters
friendlyNameThe 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 P:System.AppDomain.FriendlyName.
securityInfoEvidence that establishes the identity of the code that runs in the application domain. Pass null to use the evidence of the current application domain.
infoAn object that contains application domain initialization information.
grantSetA default permission set that is granted to all assemblies loaded into the new application domain that do not have specific grants.
fullTrustAssembliesAn array of strong names representing assemblies to be considered fully trusted in the new application domain.
Returns
The newly created application domain.
Exceptions
T:System.ArgumentNullExceptionfriendlyName is null.
T:System.InvalidOperationExceptionThe application domain is null.-or- The P:System.AppDomainSetup.ApplicationBase property is not set on the T:System.AppDomainSetup object that is supplied for info .

Definition at line 3197 of file AppDomain.cs.

◆ CreateDomain() [6/6]

static AppDomain System.AppDomain.CreateDomain ( string  friendlyName,
Evidence  securityInfo,
string  appBasePath,
string  appRelativeSearchPath,
bool  shadowCopyFiles,
AppDomainInitializer  adInit,
string []  adInitArgs 
)
static

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.

Parameters
friendlyNameThe friendly name of the domain. This friendly name can be displayed in user interfaces to identify the domain. For more information, see P:System.AppDomain.FriendlyName.
securityInfoEvidence that establishes the identity of the code that runs in the application domain. Pass null to use the evidence of the current application domain.
appBasePathThe base directory that the assembly resolver uses to probe for assemblies. For more information, see P:System.AppDomain.BaseDirectory.
appRelativeSearchPathThe path relative to the base directory where the assembly resolver should probe for private assemblies. For more information, see P:System.AppDomain.RelativeSearchPath.
shadowCopyFilestrue to load a shadow copy of an assembly into the application domain.
adInitAn T:System.AppDomainInitializer delegate that represents a callback method to invoke when the new T:System.AppDomain object is initialized.
adInitArgsAn array of string arguments to be passed to the callback represented by adInit , when the new T:System.AppDomain object is initialized.
Returns
The newly created application domain.
Exceptions
T:System.ArgumentNullExceptionfriendlyName is null.

Definition at line 3227 of file AppDomain.cs.

◆ CreateInstance() [1/4]

ObjectHandle System.AppDomain.CreateInstance ( string  assemblyName,
string  typeName 
)

Creates a new instance of the specified type defined in the specified assembly.

Parameters
assemblyNameThe display name of the assembly. See P:System.Reflection.Assembly.FullName.
typeNameThe fully qualified name of the requested type, including the namespace but not the assembly, as returned by the P:System.Type.FullName property.
Returns
An object that is a wrapper for the new instance specified by typeName . The return value needs to be unwrapped to access the real object.
Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.ArgumentNullExceptionassemblyName or typeName is null.
T:System.BadImageFormatExceptionassemblyName is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyName was compiled with a later version.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.
T:System.IO.FileNotFoundExceptionassemblyName was not found.
T:System.MethodAccessExceptionThe caller does not have permission to call this constructor.
T:System.MissingMethodExceptionNo matching public constructor was found.
T:System.TypeLoadExceptiontypename was not found in assemblyName .
T:System.NullReferenceExceptionThis instance is null.

Implements System._AppDomain.

Definition at line 1504 of file AppDomain.cs.

◆ CreateInstance() [2/4]

ObjectHandle System.AppDomain.CreateInstance ( string  assemblyName,
string  typeName,
object []  activationAttributes 
)

Creates a new instance of the specified type defined in the specified assembly. A parameter specifies an array of activation attributes.

Parameters
assemblyNameThe display name of the assembly. See P:System.Reflection.Assembly.FullName.
typeNameThe fully qualified name of the requested type, including the namespace but not the assembly, as returned by the P:System.Type.FullName property.
activationAttributesAn array of one or more attributes that can participate in activation. Typically, an array that contains a single T:System.Runtime.Remoting.Activation.UrlAttribute object that specifies the URL that is required to activate a remote object. This parameter is related to client-activated objects.Client activation is a legacy technology that is retained for backward compatibility but is not recommended for new development. Distributed applications should instead use Windows Communication Foundation.
Returns
An object that is a wrapper for the new instance specified by typeName . The return value needs to be unwrapped to access the real object.
Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.ArgumentNullExceptionassemblyName or typeName is null.
T:System.BadImageFormatExceptionassemblyName is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyName was compiled with a later version.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.
T:System.IO.FileNotFoundExceptionassemblyName was not found.
T:System.MethodAccessExceptionThe caller does not have permission to call this constructor.
T:System.MissingMethodExceptionNo matching public constructor was found.
T:System.NotSupportedExceptionThe caller cannot provide activation attributes for an object that does not inherit from T:System.MarshalByRefObject.
T:System.TypeLoadExceptiontypename was not found in assemblyName .
T:System.NullReferenceExceptionThis instance is null.

Implements System._AppDomain.

Definition at line 1637 of file AppDomain.cs.

◆ CreateInstance() [3/4]

ObjectHandle System.AppDomain.CreateInstance ( string  assemblyName,
string  typeName,
bool  ignoreCase,
BindingFlags  bindingAttr,
Binder  binder,
object []  args,
CultureInfo  culture,
object []  activationAttributes,
Evidence  securityAttributes 
)

Creates a new instance of the specified type defined in the specified assembly. Parameters specify a binder, binding flags, constructor arguments, culture-specific information used to interpret arguments, activation attributes, and authorization to create the type.

Parameters
assemblyNameThe display name of the assembly. See P:System.Reflection.Assembly.FullName.
typeNameThe fully qualified name of the requested type, including the namespace but not the assembly, as returned by the P:System.Type.FullName property.
ignoreCaseA Boolean value specifying whether to perform a case-sensitive search or not.
bindingAttrA combination of zero or more bit flags that affect the search for the typeName constructor. If bindingAttr is zero, a case-sensitive search for public constructors is conducted.
binderAn object that enables the binding, coercion of argument types, invocation of members, and retrieval of T:System.Reflection.MemberInfo objects using reflection. If binder is null, the default binder is used.
argsThe arguments to pass to the constructor. This array of arguments must match in number, order, and type the parameters of the constructor to invoke. If the default constructor is preferred, args must be an empty array or null.
cultureCulture-specific information that governs the coercion of args to the formal types declared for the typeName constructor. If culture is null, the T:System.Globalization.CultureInfo for the current thread is used.
activationAttributesAn array of one or more attributes that can participate in activation. Typically, an array that contains a single T:System.Runtime.Remoting.Activation.UrlAttribute object that specifies the URL that is required to activate a remote object. This parameter is related to client-activated objects.Client activation is a legacy technology that is retained for backward compatibility but is not recommended for new development. Distributed applications should instead use Windows Communication Foundation.
securityAttributesInformation used to authorize creation of typeName .
Returns
An object that is a wrapper for the new instance specified by typeName . The return value needs to be unwrapped to access the real object.
Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.ArgumentNullExceptionassemblyName or typeName is null.
T:System.BadImageFormatExceptionassemblyName is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyName was compiled with a later version.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.
T:System.IO.FileNotFoundExceptionassemblyName was not found.
T:System.MethodAccessExceptionThe caller does not have permission to call this constructor.
T:System.MissingMethodExceptionNo matching constructor was found.
T:System.NotSupportedExceptionThe caller cannot provide activation attributes for an object that does not inherit from T:System.MarshalByRefObject.-or- securityAttributes is not null. When legacy CAS policy is not enabled, securityAttributes should be null.
T:System.TypeLoadExceptiontypename was not found in assemblyName .
T:System.NullReferenceExceptionThis instance is null.

Implements System._AppDomain.

Definition at line 1705 of file AppDomain.cs.

◆ CreateInstance() [4/4]

ObjectHandle System.AppDomain.CreateInstance ( string  assemblyName,
string  typeName,
bool  ignoreCase,
BindingFlags  bindingAttr,
Binder  binder,
object []  args,
CultureInfo  culture,
object []  activationAttributes 
)

Creates a new instance of the specified type defined in the specified assembly. Parameters specify a binder, binding flags, constructor arguments, culture-specific information used to interpret arguments, and optional activation attributes.

Parameters
assemblyNameThe display name of the assembly. See P:System.Reflection.Assembly.FullName.
typeNameThe fully qualified name of the requested type, including the namespace but not the assembly, as returned by the P:System.Type.FullName property.
ignoreCaseA Boolean value specifying whether to perform a case-sensitive search or not.
bindingAttrA combination of zero or more bit flags that affect the search for the typeName constructor. If bindingAttr is zero, a case-sensitive search for public constructors is conducted.
binderAn object that enables the binding, coercion of argument types, invocation of members, and retrieval of T:System.Reflection.MemberInfo objects using reflection. If binder is null, the default binder is used.
argsThe arguments to pass to the constructor. This array of arguments must match in number, order, and type the parameters of the constructor to invoke. If the default constructor is preferred, args must be an empty array or null.
cultureCulture-specific information that governs the coercion of args to the formal types declared for the typeName constructor. If culture is null, the T:System.Globalization.CultureInfo for the current thread is used.
activationAttributesAn array of one or more attributes that can participate in activation. Typically, an array that contains a single T:System.Runtime.Remoting.Activation.UrlAttribute object that specifies the URL that is required to activate a remote object. This parameter is related to client-activated objects. Client activation is a legacy technology that is retained for backward compatibility but is not recommended for new development. Distributed applications should instead use Windows Communication Foundation.
Returns
An object that is a wrapper for the new instance specified by typeName . The return value needs to be unwrapped to access the real object.
Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.ArgumentNullExceptionassemblyName or typeName is null.
T:System.BadImageFormatExceptionassemblyName is not a valid assembly. -or- assemblyName was compiled with a later version of the common language runtime than the version that is currently loaded.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.
T:System.IO.FileNotFoundExceptionassemblyName was not found.
T:System.MethodAccessExceptionThe caller does not have permission to call this constructor.
T:System.MissingMethodExceptionNo matching constructor was found.
T:System.NotSupportedExceptionThe caller cannot provide activation attributes for an object that does not inherit from T:System.MarshalByRefObject.
T:System.TypeLoadExceptiontypename was not found in assemblyName .
T:System.NullReferenceExceptionThis instance is null.

Definition at line 1747 of file AppDomain.cs.

◆ CreateInstanceAndUnwrap() [1/4]

object System.AppDomain.CreateInstanceAndUnwrap ( string  assemblyName,
string  typeName 
)

Creates a new instance of the specified type. Parameters specify the assembly where the type is defined, and the name of the type.

Parameters
assemblyNameThe display name of the assembly. See P:System.Reflection.Assembly.FullName.
typeNameThe fully qualified name of the requested type, including the namespace but not the assembly, as returned by the P:System.Type.FullName property.
Returns
An instance of the object specified by typeName .
Exceptions
T:System.ArgumentNullExceptionassemblyName or typeName is null.
T:System.MissingMethodExceptionNo matching public constructor was found.
T:System.TypeLoadExceptiontypename was not found in assemblyName .
T:System.IO.FileNotFoundExceptionassemblyName was not found.
T:System.MethodAccessExceptionThe caller does not have permission to call this constructor.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.BadImageFormatExceptionassemblyName is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyName was compiled with a later version.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.

Definition at line 3747 of file AppDomain.cs.

◆ CreateInstanceAndUnwrap() [2/4]

object System.AppDomain.CreateInstanceAndUnwrap ( string  assemblyName,
string  typeName,
object []  activationAttributes 
)

Creates a new instance of the specified type. Parameters specify the assembly where the type is defined, the name of the type, and an array of activation attributes.

Parameters
assemblyNameThe display name of the assembly. See P:System.Reflection.Assembly.FullName.
typeNameThe fully qualified name of the requested type, including the namespace but not the assembly, as returned by the P:System.Type.FullName property.
activationAttributesAn array of one or more attributes that can participate in activation. Typically, an array that contains a single T:System.Runtime.Remoting.Activation.UrlAttribute object that specifies the URL that is required to activate a remote object. This parameter is related to client-activated objects.Client activation is a legacy technology that is retained for backward compatibility but is not recommended for new development. Distributed applications should instead use Windows Communication Foundation.
Returns
An instance of the object specified by typeName .
Exceptions
T:System.ArgumentNullExceptionassemblyName or typeName is null.
T:System.MissingMethodExceptionNo matching public constructor was found.
T:System.TypeLoadExceptiontypename was not found in assemblyName .
T:System.IO.FileNotFoundExceptionassemblyName was not found.
T:System.MethodAccessExceptionThe caller does not have permission to call this constructor.
T:System.NotSupportedExceptionThe caller cannot provide activation attributes for an object that does not inherit from T:System.MarshalByRefObject.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.BadImageFormatExceptionassemblyName is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyName was compiled with a later version.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.

Definition at line 3770 of file AppDomain.cs.

◆ CreateInstanceAndUnwrap() [3/4]

object System.AppDomain.CreateInstanceAndUnwrap ( string  assemblyName,
string  typeName,
bool  ignoreCase,
BindingFlags  bindingAttr,
Binder  binder,
object []  args,
CultureInfo  culture,
object []  activationAttributes,
Evidence  securityAttributes 
)

Creates a new instance of the specified type. Parameters specify the name of the type, and how it is found and created.

Parameters
assemblyNameThe display name of the assembly. See P:System.Reflection.Assembly.FullName.
typeNameThe fully qualified name of the requested type, including the namespace but not the assembly, as returned by the P:System.Type.FullName property.
ignoreCaseA Boolean value specifying whether to perform a case-sensitive search or not.
bindingAttrA combination of zero or more bit flags that affect the search for the typeName constructor. If bindingAttr is zero, a case-sensitive search for public constructors is conducted.
binderAn object that enables the binding, coercion of argument types, invocation of members, and retrieval of T:System.Reflection.MemberInfo objects using reflection. If binder is null, the default binder is used.
argsThe arguments to pass to the constructor. This array of arguments must match in number, order, and type the parameters of the constructor to invoke. If the default constructor is preferred, args must be an empty array or null.
cultureA culture-specific object used to govern the coercion of types. If culture is null, the CultureInfo for the current thread is used.
activationAttributesAn array of one or more attributes that can participate in activation. Typically, an array that contains a single T:System.Runtime.Remoting.Activation.UrlAttribute object that specifies the URL that is required to activate a remote object. This parameter is related to client-activated objects. Client activation is a legacy technology that is retained for backward compatibility but is not recommended for new development. Distributed applications should instead use Windows Communication Foundation.
securityAttributesInformation used to authorize creation of typeName .
Returns
An instance of the object specified by typeName .
Exceptions
T:System.ArgumentNullExceptionassemblyName or typeName is null.
T:System.MissingMethodExceptionNo matching constructor was found.
T:System.TypeLoadExceptiontypename was not found in assemblyName .
T:System.IO.FileNotFoundExceptionassemblyName was not found.
T:System.MethodAccessExceptionThe caller does not have permission to call this constructor.
T:System.NotSupportedExceptionThe caller cannot provide activation attributes for an object that does not inherit from T:System.MarshalByRefObject.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.BadImageFormatExceptionassemblyName is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyName was compiled with a later version.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.

Definition at line 3800 of file AppDomain.cs.

◆ CreateInstanceAndUnwrap() [4/4]

object System.AppDomain.CreateInstanceAndUnwrap ( string  assemblyName,
string  typeName,
bool  ignoreCase,
BindingFlags  bindingAttr,
Binder  binder,
object []  args,
CultureInfo  culture,
object []  activationAttributes 
)

Creates a new instance of the specified type defined in the specified assembly, specifying whether the case of the type name is ignored; the binding attributes and the binder that are used to select the type to be created; the arguments of the constructor; the culture; and the activation attributes.

Parameters
assemblyNameThe display name of the assembly. See P:System.Reflection.Assembly.FullName.
typeNameThe fully qualified name of the requested type, including the namespace but not the assembly, as returned by the P:System.Type.FullName property.
ignoreCaseA Boolean value specifying whether to perform a case-sensitive search or not.
bindingAttrA combination of zero or more bit flags that affect the search for the typeName constructor. If bindingAttr is zero, a case-sensitive search for public constructors is conducted.
binderAn object that enables the binding, coercion of argument types, invocation of members, and retrieval of T:System.Reflection.MemberInfo objects using reflection. If binder is null, the default binder is used.
argsThe arguments to pass to the constructor. This array of arguments must match in number, order, and type the parameters of the constructor to invoke. If the default constructor is preferred, args must be an empty array or null.
cultureA culture-specific object used to govern the coercion of types. If culture is null, the CultureInfo for the current thread is used.
activationAttributesAn array of one or more attributes that can participate in activation. Typically, an array that contains a single T:System.Runtime.Remoting.Activation.UrlAttribute object. that specifies the URL that is required to activate a remote object. This parameter is related to client-activated objects. Client activation is a legacy technology that is retained for backward compatibility but is not recommended for new development. Distributed applications should instead use Windows Communication Foundation.
Returns
An instance of the object specified by typeName .
Exceptions
T:System.ArgumentNullExceptionassemblyName or typeName is null.
T:System.MissingMethodExceptionNo matching constructor was found.
T:System.TypeLoadExceptiontypename was not found in assemblyName .
T:System.IO.FileNotFoundExceptionassemblyName was not found.
T:System.MethodAccessExceptionThe caller does not have permission to call this constructor.
T:System.NotSupportedExceptionThe caller cannot provide activation attributes for an object that does not inherit from T:System.MarshalByRefObject.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.BadImageFormatExceptionassemblyName is not a valid assembly. -or- assemblyName was compiled with a later version of the common language runtime than the version that is currently loaded.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.

Definition at line 3829 of file AppDomain.cs.

◆ CreateInstanceFrom() [1/4]

ObjectHandle System.AppDomain.CreateInstanceFrom ( string  assemblyFile,
string  typeName 
)

Creates a new instance of the specified type defined in the specified assembly file.

Parameters
assemblyFileThe name, including the path, of a file that contains an assembly that defines the requested type. The assembly is loaded using the M:System.Reflection.Assembly.LoadFrom(System.String) method.
typeNameThe fully qualified name of the requested type, including the namespace but not the assembly, as returned by the P:System.Type.FullName property.
Returns
An object that is a wrapper for the new instance, or null if typeName is not found. The return value needs to be unwrapped to access the real object.
Exceptions
T:System.ArgumentNullExceptionassemblyFile is null.-or- typeName is null.
T:System.IO.FileNotFoundExceptionassemblyFile was not found.
T:System.TypeLoadExceptiontypeName was not found in assemblyFile .
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.MissingMethodExceptionNo parameterless public constructor was found.
T:System.MethodAccessExceptionThe caller does not have sufficient permission to call this constructor.
T:System.BadImageFormatExceptionassemblyFile is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyFile was compiled with a later version.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.
T:System.NullReferenceExceptionThis instance is null.

Implements System._AppDomain.

Definition at line 1542 of file AppDomain.cs.

◆ CreateInstanceFrom() [2/4]

ObjectHandle System.AppDomain.CreateInstanceFrom ( string  assemblyFile,
string  typeName,
object []  activationAttributes 
)

Creates a new instance of the specified type defined in the specified assembly file.

Parameters
assemblyFileThe name, including the path, of a file that contains an assembly that defines the requested type. The assembly is loaded using the M:System.Reflection.Assembly.LoadFrom(System.String) method.
typeNameThe fully qualified name of the requested type, including the namespace but not the assembly, as returned by the P:System.Type.FullName property.
activationAttributesAn array of one or more attributes that can participate in activation. Typically, an array that contains a single T:System.Runtime.Remoting.Activation.UrlAttribute object that specifies the URL that is required to activate a remote object. This parameter is related to client-activated objects.Client activation is a legacy technology that is retained for backward compatibility but is not recommended for new development. Distributed applications should instead use Windows Communication Foundation.
Returns
An object that is a wrapper for the new instance, or null if typeName is not found. The return value needs to be unwrapped to access the real object.
Exceptions
T:System.ArgumentNullExceptionassemblyFile is null.
T:System.IO.FileNotFoundExceptionassemblyFile was not found.
T:System.TypeLoadExceptiontypeName was not found in assemblyFile .
T:System.MethodAccessExceptionThe caller does not have sufficient permission to call this constructor.
T:System.MissingMethodExceptionNo matching public constructor was found.
T:System.NotSupportedExceptionThe caller cannot provide activation attributes for an object that does not inherit from T:System.MarshalByRefObject.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.BadImageFormatExceptionassemblyFile is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyFile was compiled with a later version.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.
T:System.NullReferenceExceptionThis instance is null.

Implements System._AppDomain.

Definition at line 1669 of file AppDomain.cs.

◆ CreateInstanceFrom() [3/4]

ObjectHandle System.AppDomain.CreateInstanceFrom ( string  assemblyFile,
string  typeName,
bool  ignoreCase,
BindingFlags  bindingAttr,
Binder  binder,
object []  args,
CultureInfo  culture,
object []  activationAttributes,
Evidence  securityAttributes 
)

Creates a new instance of the specified type defined in the specified assembly file.

Parameters
assemblyFileThe name, including the path, of a file that contains an assembly that defines the requested type. The assembly is loaded using the M:System.Reflection.Assembly.LoadFrom(System.String) method.
typeNameThe fully qualified name of the requested type, including the namespace but not the assembly, as returned by the P:System.Type.FullName property.
ignoreCaseA Boolean value specifying whether to perform a case-sensitive search or not.
bindingAttrA combination of zero or more bit flags that affect the search for the typeName constructor. If bindingAttr is zero, a case-sensitive search for public constructors is conducted.
binderAn object that enables the binding, coercion of argument types, invocation of members, and retrieval of T:System.Reflection.MemberInfo objects through reflection. If binder is null, the default binder is used.
argsThe arguments to pass to the constructor. This array of arguments must match in number, order, and type the parameters of the constructor to invoke. If the default constructor is preferred, args must be an empty array or null.
cultureCulture-specific information that governs the coercion of args to the formal types declared for the typeName constructor. If culture is null, the T:System.Globalization.CultureInfo for the current thread is used.
activationAttributesAn array of one or more attributes that can participate in activation. Typically, an array that contains a single T:System.Runtime.Remoting.Activation.UrlAttribute object that specifies the URL that is required to activate a remote object. This parameter is related to client-activated objects. Client activation is a legacy technology that is retained for backward compatibility but is not recommended for new development. Distributed applications should instead use Windows Communication Foundation.
securityAttributesInformation used to authorize creation of typeName .
Returns
An object that is a wrapper for the new instance, or null if typeName is not found. The return value needs to be unwrapped to access the real object.
Exceptions
T:System.ArgumentNullExceptionassemblyFile is null.-or- typeName is null.
T:System.NotSupportedExceptionThe caller cannot provide activation attributes for an object that does not inherit from T:System.MarshalByRefObject.-or- securityAttributes is not null. When legacy CAS policy is not enabled, securityAttributes should be null.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.IO.FileNotFoundExceptionassemblyFile was not found.
T:System.TypeLoadExceptiontypeName was not found in assemblyFile .
T:System.MissingMethodExceptionNo matching public constructor was found.
T:System.MethodAccessExceptionThe caller does not have sufficient permission to call this constructor.
T:System.BadImageFormatExceptionassemblyFile is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyFile was compiled with a later version.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.
T:System.NullReferenceExceptionThis instance is null.

Implements System._AppDomain.

Definition at line 1795 of file AppDomain.cs.

◆ CreateInstanceFrom() [4/4]

ObjectHandle System.AppDomain.CreateInstanceFrom ( string  assemblyFile,
string  typeName,
bool  ignoreCase,
BindingFlags  bindingAttr,
Binder  binder,
object []  args,
CultureInfo  culture,
object []  activationAttributes 
)

Creates a new instance of the specified type defined in the specified assembly file.

Parameters
assemblyFileThe name, including the path, of a file that contains an assembly that defines the requested type. The assembly is loaded using the M:System.Reflection.Assembly.LoadFrom(System.String) method.
typeNameThe fully qualified name of the requested type, including the namespace but not the assembly, as returned by the P:System.Type.FullName property.
ignoreCaseA Boolean value specifying whether to perform a case-sensitive search or not.
bindingAttrA combination of zero or more bit flags that affect the search for the typeName constructor. If bindingAttr is zero, a case-sensitive search for public constructors is conducted.
binderAn object that enables the binding, coercion of argument types, invocation of members, and retrieval of T:System.Reflection.MemberInfo objects through reflection. If binder is null, the default binder is used.
argsThe arguments to pass to the constructor. This array of arguments must match in number, order, and type the parameters of the constructor to invoke. If the default constructor is preferred, args must be an empty array or null.
cultureCulture-specific information that governs the coercion of args to the formal types declared for the typeName constructor. If culture is null, the T:System.Globalization.CultureInfo for the current thread is used.
activationAttributesAn array of one or more attributes that can participate in activation. Typically, an array that contains a single T:System.Runtime.Remoting.Activation.UrlAttribute object that specifies the URL that is required to activate a remote object. This parameter is related to client-activated objects. Client activation is a legacy technology that is retained for backward compatibility but is not recommended for new development. Distributed applications should instead use Windows Communication Foundation.
Returns
An object that is a wrapper for the new instance, or null if typeName is not found. The return value needs to be unwrapped to access the real object.
Exceptions
T:System.ArgumentNullExceptionassemblyFile is null.-or- typeName is null.
T:System.NotSupportedExceptionThe caller cannot provide activation attributes for an object that does not inherit from T:System.MarshalByRefObject.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.IO.FileNotFoundExceptionassemblyFile was not found.
T:System.TypeLoadExceptiontypeName was not found in assemblyFile .
T:System.MissingMethodExceptionNo matching public constructor was found.
T:System.MethodAccessExceptionThe caller does not have sufficient permission to call this constructor.
T:System.BadImageFormatExceptionassemblyFile is not a valid assembly. -or- assemblyFile was compiled with a later version of the common language runtime than the version that is currently loaded.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.
T:System.NullReferenceExceptionThis instance is null.

Definition at line 1834 of file AppDomain.cs.

◆ CreateInstanceFromAndUnwrap() [1/4]

object System.AppDomain.CreateInstanceFromAndUnwrap ( string  assemblyName,
string  typeName 
)

Creates a new instance of the specified type defined in the specified assembly file.

Parameters
assemblyNameThe file name and path of the assembly that defines the requested type.
typeNameThe fully qualified name of the requested type, including the namespace but not the assembly, as returned by the P:System.Type.FullName property.
Returns
The requested object, or null if typeName is not found.
Exceptions
T:System.ArgumentNullExceptionassemblyName is null.-or- typeName is null.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.IO.FileNotFoundExceptionassemblyName was not found.
T:System.TypeLoadExceptiontypeName was not found in assemblyName .
T:System.MissingMethodExceptionNo parameterless public constructor was found.
T:System.MethodAccessExceptionThe caller does not have sufficient permission to call this constructor.
T:System.BadImageFormatExceptionassemblyName is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyName was compiled with a later version.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.

Definition at line 3851 of file AppDomain.cs.

◆ CreateInstanceFromAndUnwrap() [2/4]

object System.AppDomain.CreateInstanceFromAndUnwrap ( string  assemblyName,
string  typeName,
object []  activationAttributes 
)

Creates a new instance of the specified type defined in the specified assembly file.

Parameters
assemblyNameThe file name and path of the assembly that defines the requested type.
typeNameThe fully qualified name of the requested type, including the namespace but not the assembly (see the P:System.Type.FullName property).
activationAttributesAn array of one or more attributes that can participate in activation. Typically, an array that contains a single T:System.Runtime.Remoting.Activation.UrlAttribute object that specifies the URL that is required to activate a remote object. This parameter is related to client-activated objects.Client activation is a legacy technology that is retained for backward compatibility but is not recommended for new development. Distributed applications should instead use Windows Communication Foundation.
Returns
The requested object, or null if typeName is not found.
Exceptions
T:System.ArgumentNullExceptionassemblyName is null.-or- typeName is null.
T:System.NotSupportedExceptionThe caller cannot provide activation attributes for an object that does not inherit from T:System.MarshalByRefObject.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.IO.FileNotFoundExceptionassemblyName was not found.
T:System.TypeLoadExceptiontypeName was not found in assemblyName .
T:System.MissingMethodExceptionNo parameterless public constructor was found.
T:System.MethodAccessExceptionThe caller does not have sufficient permission to call this constructor.
T:System.BadImageFormatExceptionassemblyName is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyName was compiled with a later version.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.

Definition at line 3875 of file AppDomain.cs.

◆ CreateInstanceFromAndUnwrap() [3/4]

object System.AppDomain.CreateInstanceFromAndUnwrap ( string  assemblyName,
string  typeName,
bool  ignoreCase,
BindingFlags  bindingAttr,
Binder  binder,
object []  args,
CultureInfo  culture,
object []  activationAttributes,
Evidence  securityAttributes 
)

Creates a new instance of the specified type defined in the specified assembly file.

Parameters
assemblyNameThe file name and path of the assembly that defines the requested type.
typeNameThe fully qualified name of the requested type, including the namespace but not the assembly, as returned by the P:System.Type.FullName property.
ignoreCaseA Boolean value specifying whether to perform a case-sensitive search or not.
bindingAttrA combination of zero or more bit flags that affect the search for the typeName constructor. If bindingAttr is zero, a case-sensitive search for public constructors is conducted.
binderAn object that enables the binding, coercion of argument types, invocation of members, and retrieval of T:System.Reflection.MemberInfo objects through reflection. If binder is null, the default binder is used.
argsThe arguments to pass to the constructor. This array of arguments must match in number, order, and type the parameters of the constructor to invoke. If the default constructor is preferred, args must be an empty array or null.
cultureCulture-specific information that governs the coercion of args to the formal types declared for the typeName constructor. If culture is null, the T:System.Globalization.CultureInfo for the current thread is used.
activationAttributesAn array of one or more attributes that can participate in activation. Typically, an array that contains a single T:System.Runtime.Remoting.Activation.UrlAttribute object that specifies the URL that is required to activate a remote object. This parameter is related to client-activated objects. Client activation is a legacy technology that is retained for backward compatibility but is not recommended for new development. Distributed applications should instead use Windows Communication Foundation.
securityAttributesInformation used to authorize creation of typeName .
Returns
The requested object, or null if typeName is not found.
Exceptions
T:System.ArgumentNullExceptionassemblyName is null.-or- typeName is null.
T:System.NotSupportedExceptionThe caller cannot provide activation attributes for an object that does not inherit from T:System.MarshalByRefObject.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.IO.FileNotFoundExceptionassemblyName was not found.
T:System.TypeLoadExceptiontypeName was not found in assemblyName .
T:System.MissingMethodExceptionNo matching public constructor was found.
T:System.MethodAccessExceptionThe caller does not have sufficient permission to call this constructor.
T:System.BadImageFormatExceptionassemblyName is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyName was compiled with a later version.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.

Definition at line 3906 of file AppDomain.cs.

◆ CreateInstanceFromAndUnwrap() [4/4]

object System.AppDomain.CreateInstanceFromAndUnwrap ( string  assemblyFile,
string  typeName,
bool  ignoreCase,
BindingFlags  bindingAttr,
Binder  binder,
object []  args,
CultureInfo  culture,
object []  activationAttributes 
)

Creates a new instance of the specified type defined in the specified assembly file, specifying whether the case of the type name is ignored; the binding attributes and the binder that are used to select the type to be created; the arguments of the constructor; the culture; and the activation attributes.

Parameters
assemblyFileThe file name and path of the assembly that defines the requested type.
typeNameThe fully qualified name of the requested type, including the namespace but not the assembly, as returned by the P:System.Type.FullName property.
ignoreCaseA Boolean value specifying whether to perform a case-sensitive search or not.
bindingAttrA combination of zero or more bit flags that affect the search for the typeName constructor. If bindingAttr is zero, a case-sensitive search for public constructors is conducted.
binderAn object that enables the binding, coercion of argument types, invocation of members, and retrieval of T:System.Reflection.MemberInfo objects through reflection. If binder is null, the default binder is used.
argsThe arguments to pass to the constructor. This array of arguments must match in number, order, and type the parameters of the constructor to invoke. If the default constructor is preferred, args must be an empty array or null.
cultureCulture-specific information that governs the coercion of args to the formal types declared for the typeName constructor. If culture is null, the T:System.Globalization.CultureInfo for the current thread is used.
activationAttributesAn array of one or more attributes that can participate in activation. Typically, an array that contains a single T:System.Runtime.Remoting.Activation.UrlAttribute object that specifies the URL that is required to activate a remote object. This parameter is related to client-activated objects. Client activation is a legacy technology that is retained for backward compatibility but is not recommended for new development. Distributed applications should instead use Windows Communication Foundation.
Returns
The requested object, or null if typeName is not found.
Exceptions
T:System.ArgumentNullExceptionassemblyName is null.-or- typeName is null.
T:System.NotSupportedExceptionThe caller cannot provide activation attributes for an object that does not inherit from T:System.MarshalByRefObject.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.IO.FileNotFoundExceptionassemblyName was not found.
T:System.TypeLoadExceptiontypeName was not found in assemblyName .
T:System.MissingMethodExceptionNo matching public constructor was found.
T:System.MethodAccessExceptionThe caller does not have sufficient permission to call this constructor.
T:System.BadImageFormatExceptionassemblyName is not a valid assembly. -or- assemblyName was compiled with a later version of the common language runtime that the version that is currently loaded.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.

Definition at line 3936 of file AppDomain.cs.

◆ DefineDynamicAssembly() [1/13]

AssemblyBuilder System.AppDomain.DefineDynamicAssembly ( AssemblyName  name,
AssemblyBuilderAccess  access 
)

Defines a dynamic assembly with the specified name and access mode.

Parameters
nameThe unique identity of the dynamic assembly.
accessThe access mode for the dynamic assembly.
Returns
A dynamic assembly with the specified name and access mode.
Exceptions
T:System.ArgumentNullExceptionname is null.
T:System.ArgumentExceptionThe Name property of name is null.-or- The Name property of name begins with white space, or contains a forward or backward slash.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Implements System._AppDomain.

Definition at line 1207 of file AppDomain.cs.

◆ DefineDynamicAssembly() [2/13]

AssemblyBuilder System.AppDomain.DefineDynamicAssembly ( AssemblyName  name,
AssemblyBuilderAccess  access,
IEnumerable< CustomAttributeBuilder assemblyAttributes 
)

Defines a dynamic assembly with the specified name, access mode, and custom attributes.

Parameters
nameThe unique identity of the dynamic assembly.
accessThe access mode for the dynamic assembly.
assemblyAttributesAn enumerable list of attributes to be applied to the assembly, or null if there are no attributes.
Returns
A dynamic assembly with the specified name and features.
Exceptions
T:System.ArgumentNullExceptionname is null.
T:System.ArgumentExceptionThe Name property of name is null.-or- The Name property of name starts with white space, or contains a forward or backward slash.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Definition at line 1224 of file AppDomain.cs.

◆ DefineDynamicAssembly() [3/13]

AssemblyBuilder System.AppDomain.DefineDynamicAssembly ( AssemblyName  name,
AssemblyBuilderAccess  access,
IEnumerable< CustomAttributeBuilder assemblyAttributes,
SecurityContextSource  securityContextSource 
)

Defines a dynamic assembly with the specified name, access mode, and custom attributes, and using the specified source for its security context.

Parameters
nameThe unique identity of the dynamic assembly.
accessThe access mode for the dynamic assembly.
assemblyAttributesAn enumerable list of attributes to be applied to the assembly, or null if there are no attributes.
securityContextSourceThe source of the security context.
Returns
A dynamic assembly with the specified name and features.
Exceptions
T:System.ArgumentNullExceptionname is null.
T:System.ArgumentExceptionThe Name property of name is null.-or- The Name property of name starts with white space, or contains a forward or backward slash.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.ArgumentOutOfRangeExceptionThe value of securityContextSource was not one of the enumeration values.

Definition at line 1244 of file AppDomain.cs.

◆ DefineDynamicAssembly() [4/13]

AssemblyBuilder System.AppDomain.DefineDynamicAssembly ( AssemblyName  name,
AssemblyBuilderAccess  access,
string  dir 
)

Defines a dynamic assembly using the specified name, access mode, and storage directory.

Parameters
nameThe unique identity of the dynamic assembly.
accessThe mode in which the dynamic assembly will be accessed.
dirThe name of the directory where the assembly will be saved. If dir is null, the directory defaults to the current directory.
Returns
A dynamic assembly with the specified name and features.
Exceptions
T:System.ArgumentNullExceptionname is null.
T:System.ArgumentExceptionThe Name property of name is null.-or- The Name property of name begins with white space, or contains a forward or backward slash.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Implements System._AppDomain.

Definition at line 1261 of file AppDomain.cs.

◆ DefineDynamicAssembly() [5/13]

AssemblyBuilder System.AppDomain.DefineDynamicAssembly ( AssemblyName  name,
AssemblyBuilderAccess  access,
Evidence  evidence 
)

Defines a dynamic assembly using the specified name, access mode, and evidence.

Parameters
nameThe unique identity of the dynamic assembly.
accessThe mode in which the dynamic assembly will be accessed.
evidenceThe evidence supplied for the dynamic assembly. The evidence is used unaltered as the final set of evidence used for policy resolution.
Returns
A dynamic assembly with the specified name and features.
Exceptions
T:System.ArgumentNullExceptionname is null.
T:System.ArgumentExceptionThe Name property of name is null.-or- The Name property of name begins with white space, or contains a forward or backward slash.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Implements System._AppDomain.

Definition at line 1279 of file AppDomain.cs.

◆ DefineDynamicAssembly() [6/13]

AssemblyBuilder System.AppDomain.DefineDynamicAssembly ( AssemblyName  name,
AssemblyBuilderAccess  access,
PermissionSet  requiredPermissions,
PermissionSet  optionalPermissions,
PermissionSet  refusedPermissions 
)

Defines a dynamic assembly using the specified name, access mode, and permission requests.

Parameters
nameThe unique identity of the dynamic assembly.
accessThe mode in which the dynamic assembly will be accessed.
requiredPermissionsThe required permissions request.
optionalPermissionsThe optional permissions request.
refusedPermissionsThe refused permissions request.
Returns
A dynamic assembly with the specified name and features.
Exceptions
T:System.ArgumentNullExceptionname is null.
T:System.ArgumentExceptionThe Name property of name is null.-or- The Name property of name begins with white space, or contains a forward or backward slash.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Implements System._AppDomain.

Definition at line 1299 of file AppDomain.cs.

◆ DefineDynamicAssembly() [7/13]

AssemblyBuilder System.AppDomain.DefineDynamicAssembly ( AssemblyName  name,
AssemblyBuilderAccess  access,
string  dir,
Evidence  evidence 
)

Defines a dynamic assembly using the specified name, access mode, storage directory, and evidence.

Parameters
nameThe unique identity of the dynamic assembly.
accessThe mode in which the dynamic assembly will be accessed.
dirThe name of the directory where the assembly will be saved. If dir is null, the directory defaults to the current directory.
evidenceThe evidence supplied for the dynamic assembly. The evidence is used unaltered as the final set of evidence used for policy resolution.
Returns
A dynamic assembly with the specified name and features.
Exceptions
T:System.ArgumentNullExceptionname is null.
T:System.ArgumentExceptionThe Name property of name is null.-or- The Name property of name begins with white space, or contains a forward or backward slash.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Implements System._AppDomain.

Definition at line 1318 of file AppDomain.cs.

◆ DefineDynamicAssembly() [8/13]

AssemblyBuilder System.AppDomain.DefineDynamicAssembly ( AssemblyName  name,
AssemblyBuilderAccess  access,
string  dir,
PermissionSet  requiredPermissions,
PermissionSet  optionalPermissions,
PermissionSet  refusedPermissions 
)

Defines a dynamic assembly using the specified name, access mode, storage directory, and permission requests.

Parameters
nameThe unique identity of the dynamic assembly.
accessThe mode in which the dynamic assembly will be accessed.
dirThe name of the directory where the assembly will be saved. If dir is null, the directory defaults to the current directory.
requiredPermissionsThe required permissions request.
optionalPermissionsThe optional permissions request.
refusedPermissionsThe refused permissions request.
Returns
A dynamic assembly with the specified name and features.
Exceptions
T:System.ArgumentNullExceptionname is null.
T:System.ArgumentExceptionThe Name property of name is null.-or- The Name property of name begins with white space, or contains a forward or backward slash.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Implements System._AppDomain.

Definition at line 1339 of file AppDomain.cs.

◆ DefineDynamicAssembly() [9/13]

AssemblyBuilder System.AppDomain.DefineDynamicAssembly ( AssemblyName  name,
AssemblyBuilderAccess  access,
Evidence  evidence,
PermissionSet  requiredPermissions,
PermissionSet  optionalPermissions,
PermissionSet  refusedPermissions 
)

Defines a dynamic assembly using the specified name, access mode, evidence, and permission requests.

Parameters
nameThe unique identity of the dynamic assembly.
accessThe mode in which the dynamic assembly will be accessed.
evidenceThe evidence supplied for the dynamic assembly. The evidence is used unaltered as the final set of evidence used for policy resolution.
requiredPermissionsThe required permissions request.
optionalPermissionsThe optional permissions request.
refusedPermissionsThe refused permissions request.
Returns
A dynamic assembly with the specified name and features.
Exceptions
T:System.ArgumentNullExceptionname is null.
T:System.ArgumentExceptionThe Name property of name is null.-or- The Name property of name begins with white space, or contains a forward or backward slash.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Implements System._AppDomain.

Definition at line 1360 of file AppDomain.cs.

◆ DefineDynamicAssembly() [10/13]

AssemblyBuilder System.AppDomain.DefineDynamicAssembly ( AssemblyName  name,
AssemblyBuilderAccess  access,
string  dir,
Evidence  evidence,
PermissionSet  requiredPermissions,
PermissionSet  optionalPermissions,
PermissionSet  refusedPermissions 
)

Defines a dynamic assembly using the specified name, access mode, storage directory, evidence, and permission requests.

Parameters
nameThe unique identity of the dynamic assembly.
accessThe mode in which the dynamic assembly will be accessed.
dirThe name of the directory where the assembly will be saved. If dir is null, the directory defaults to the current directory.
evidenceThe evidence supplied for the dynamic assembly. The evidence is used unaltered as the final set of evidence used for policy resolution.
requiredPermissionsThe required permissions request.
optionalPermissionsThe optional permissions request.
refusedPermissionsThe refused permissions request.
Returns
A dynamic assembly with the specified name and features.
Exceptions
T:System.ArgumentNullExceptionname is null.
T:System.ArgumentExceptionThe Name property of name is null.-or- The Name property of name begins with white space, or contains a forward or backward slash.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Implements System._AppDomain.

Definition at line 1382 of file AppDomain.cs.

◆ DefineDynamicAssembly() [11/13]

AssemblyBuilder System.AppDomain.DefineDynamicAssembly ( AssemblyName  name,
AssemblyBuilderAccess  access,
string  dir,
Evidence  evidence,
PermissionSet  requiredPermissions,
PermissionSet  optionalPermissions,
PermissionSet  refusedPermissions,
bool  isSynchronized 
)

Defines a dynamic assembly using the specified name, access mode, storage directory, evidence, permission requests, and synchronization option.

Parameters
nameThe unique identity of the dynamic assembly.
accessThe mode in which the dynamic assembly will be accessed.
dirThe name of the directory where the dynamic assembly will be saved. If dir is null, the directory defaults to the current directory.
evidenceThe evidence supplied for the dynamic assembly. The evidence is used unaltered as the final set of evidence used for policy resolution.
requiredPermissionsThe required permissions request.
optionalPermissionsThe optional permissions request.
refusedPermissionsThe refused permissions request.
isSynchronizedtrue to synchronize the creation of modules, types, and members in the dynamic assembly; otherwise, false.
Returns
A dynamic assembly with the specified name and features.
Exceptions
T:System.ArgumentNullExceptionname is null.
T:System.ArgumentExceptionThe Name property of name is null.-or- The Name property of name begins with white space, or contains a forward or backward slash.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Implements System._AppDomain.

Definition at line 1406 of file AppDomain.cs.

◆ DefineDynamicAssembly() [12/13]

AssemblyBuilder System.AppDomain.DefineDynamicAssembly ( AssemblyName  name,
AssemblyBuilderAccess  access,
string  dir,
Evidence  evidence,
PermissionSet  requiredPermissions,
PermissionSet  optionalPermissions,
PermissionSet  refusedPermissions,
bool  isSynchronized,
IEnumerable< CustomAttributeBuilder assemblyAttributes 
)

Defines a dynamic assembly with the specified name, access mode, storage directory, evidence, permission requests, synchronization option, and custom attributes.

Parameters
nameThe unique identity of the dynamic assembly.
accessThe mode in which the dynamic assembly will be accessed.
dirThe name of the directory where the dynamic assembly will be saved. If dir is null, the current directory is used.
evidenceThe evidence that is supplied for the dynamic assembly. The evidence is used unaltered as the final set of evidence used for policy resolution.
requiredPermissionsThe required permissions request.
optionalPermissionsThe optional permissions request.
refusedPermissionsThe refused permissions request.
isSynchronizedtrue to synchronize the creation of modules, types, and members in the dynamic assembly; otherwise, false.
assemblyAttributesAn enumerable list of attributes to be applied to the assembly, or null if there are no attributes.
Returns
A dynamic assembly with the specified name and features.
Exceptions
T:System.ArgumentNullExceptionname is null.
T:System.ArgumentExceptionThe Name property of name is null.-or- The Name property of name starts with white space, or contains a forward or backward slash.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Definition at line 1431 of file AppDomain.cs.

◆ DefineDynamicAssembly() [13/13]

AssemblyBuilder System.AppDomain.DefineDynamicAssembly ( AssemblyName  name,
AssemblyBuilderAccess  access,
string  dir,
bool  isSynchronized,
IEnumerable< CustomAttributeBuilder assemblyAttributes 
)

Defines a dynamic assembly using the specified name, access mode, storage directory, and synchronization option.

Parameters
nameThe unique identity of the dynamic assembly.
accessThe mode in which the dynamic assembly will be accessed.
dirThe name of the directory where the dynamic assembly will be saved. If dir is null, the current directory is used.
isSynchronizedtrue to synchronize the creation of modules, types, and members in the dynamic assembly; otherwise, false.
assemblyAttributesAn enumerable list of attributes to be applied to the assembly, or null if there are no attributes.
Returns
A dynamic assembly with the specified name and features.
Exceptions
T:System.ArgumentNullExceptionname is null.
T:System.ArgumentExceptionThe Name property of name is null.-or- The Name property of name starts with white space, or contains a forward or backward slash.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Definition at line 1451 of file AppDomain.cs.

◆ DoCallBack()

void System.AppDomain.DoCallBack ( CrossAppDomainDelegate  callBackDelegate)

Executes the code in another application domain that is identified by the specified delegate.

Parameters
callBackDelegateA delegate that specifies a method to call.
Exceptions
T:System.ArgumentNullExceptioncallBackDelegate is null.

Implements System._AppDomain.

Definition at line 2732 of file AppDomain.cs.

◆ ExecuteAssembly() [1/6]

int System.AppDomain.ExecuteAssembly ( string  assemblyFile)

Executes the assembly contained in the specified file.

Parameters
assemblyFileThe name of the file that contains the assembly to execute.
Returns
The value returned by the entry point of the assembly.
Exceptions
T:System.ArgumentNullExceptionassemblyFile is null.
T:System.IO.FileNotFoundExceptionassemblyFile is not found.
T:System.BadImageFormatExceptionassemblyFile is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyFile was compiled with a later version.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.
T:System.MissingMethodExceptionThe specified assembly has no entry point.

Implements System._AppDomain.

Definition at line 2005 of file AppDomain.cs.

◆ ExecuteAssembly() [2/6]

int System.AppDomain.ExecuteAssembly ( string  assemblyFile,
Evidence  assemblySecurity 
)

Executes the assembly contained in the specified file, using the specified evidence.

Parameters
assemblyFileThe name of the file that contains the assembly to execute.
assemblySecurityEvidence for loading the assembly.
Returns
The value returned by the entry point of the assembly.
Exceptions
T:System.ArgumentNullExceptionassemblyFile is null.
T:System.IO.FileNotFoundExceptionassemblyFile is not found.
T:System.BadImageFormatExceptionassemblyFile is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyFile was compiled with a later version.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.
T:System.MissingMethodExceptionThe specified assembly has no entry point.

Implements System._AppDomain.

Definition at line 2025 of file AppDomain.cs.

◆ ExecuteAssembly() [3/6]

int System.AppDomain.ExecuteAssembly ( string  assemblyFile,
Evidence  assemblySecurity,
string []  args 
)

Executes the assembly contained in the specified file, using the specified evidence and arguments.

Parameters
assemblyFileThe name of the file that contains the assembly to execute.
assemblySecurityThe supplied evidence for the assembly.
argsThe arguments to the entry point of the assembly.
Returns
The value returned by the entry point of the assembly.
Exceptions
T:System.ArgumentNullExceptionassemblyFile is null.
T:System.IO.FileNotFoundExceptionassemblyFile is not found.
T:System.BadImageFormatExceptionassemblyFile is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyFile was compiled with a later version.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.
T:System.NotSupportedExceptionassemblySecurity is not null. When legacy CAS policy is not enabled, assemblySecurity should be null.
T:System.MissingMethodExceptionThe specified assembly has no entry point.

Implements System._AppDomain.

Definition at line 2048 of file AppDomain.cs.

◆ ExecuteAssembly() [4/6]

int System.AppDomain.ExecuteAssembly ( string  assemblyFile,
string []  args 
)

Executes the assembly contained in the specified file, using the specified arguments.

Parameters
assemblyFileThe name of the file that contains the assembly to execute.
argsThe arguments to the entry point of the assembly.
Returns
The value that is returned by the entry point of the assembly.
Exceptions
T:System.ArgumentNullExceptionassemblyFile is null.
T:System.IO.FileNotFoundExceptionassemblyFile is not found.
T:System.BadImageFormatExceptionassemblyFile is not a valid assembly. -or- assemblyFile was compiled with a later version of the common language runtime than the version that is currently loaded.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.
T:System.MissingMethodExceptionThe specified assembly has no entry point.

Definition at line 2077 of file AppDomain.cs.

◆ ExecuteAssembly() [5/6]

int System.AppDomain.ExecuteAssembly ( string  assemblyFile,
Evidence  assemblySecurity,
string []  args,
byte []  hashValue,
AssemblyHashAlgorithm  hashAlgorithm 
)

Executes the assembly contained in the specified file, using the specified evidence, arguments, hash value, and hash algorithm.

Parameters
assemblyFileThe name of the file that contains the assembly to execute.
assemblySecurityThe supplied evidence for the assembly.
argsThe arguments to the entry point of the assembly.
hashValueRepresents the value of the computed hash code.
hashAlgorithmRepresents the hash algorithm used by the assembly manifest.
Returns
The value returned by the entry point of the assembly.
Exceptions
T:System.ArgumentNullExceptionassemblyFile is null.
T:System.IO.FileNotFoundExceptionassemblyFile is not found.
T:System.BadImageFormatExceptionassemblyFile is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyFile was compiled with a later version.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.
T:System.NotSupportedExceptionassemblySecurity is not null. When legacy CAS policy is not enabled, assemblySecurity should be null.
T:System.MissingMethodExceptionThe specified assembly has no entry point.

Definition at line 2107 of file AppDomain.cs.

◆ ExecuteAssembly() [6/6]

int System.AppDomain.ExecuteAssembly ( string  assemblyFile,
string []  args,
byte []  hashValue,
AssemblyHashAlgorithm  hashAlgorithm 
)

Executes the assembly contained in the specified file, using the specified arguments, hash value, and hash algorithm.

Parameters
assemblyFileThe name of the file that contains the assembly to execute.
argsThe arguments to the entry point of the assembly.
hashValueRepresents the value of the computed hash code.
hashAlgorithmRepresents the hash algorithm used by the assembly manifest.
Returns
The value that is returned by the entry point of the assembly.
Exceptions
T:System.ArgumentNullExceptionassemblyFile is null.
T:System.IO.FileNotFoundExceptionassemblyFile is not found.
T:System.BadImageFormatExceptionassemblyFile is not a valid assembly. -or- assemblyFile was compiled with a later version of the common language runtime than the version that is currently loaded.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.
T:System.MissingMethodExceptionThe specified assembly has no entry point.

Definition at line 2138 of file AppDomain.cs.

◆ ExecuteAssemblyByName() [1/6]

int System.AppDomain.ExecuteAssemblyByName ( string  assemblyName)

Executes an assembly given its display name.

Parameters
assemblyNameThe display name of the assembly. See P:System.Reflection.Assembly.FullName.
Returns
The value returned by the entry point of the assembly.
Exceptions
T:System.ArgumentNullExceptionassemblyName is null.
T:System.IO.FileNotFoundExceptionThe assembly specified by assemblyName is not found.
T:System.BadImageFormatExceptionThe assembly specified by assemblyName is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyName was compiled with a later version.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.IO.FileLoadExceptionThe assembly specified by assemblyName was found, but could not be loaded.
T:System.MissingMethodExceptionThe specified assembly has no entry point.

Definition at line 2159 of file AppDomain.cs.

◆ ExecuteAssemblyByName() [2/6]

int System.AppDomain.ExecuteAssemblyByName ( string  assemblyName,
Evidence  assemblySecurity 
)

Executes an assembly given its display name, using the specified evidence.

Parameters
assemblyNameThe display name of the assembly. See P:System.Reflection.Assembly.FullName.
assemblySecurityEvidence for loading the assembly.
Returns
The value returned by the entry point of the assembly.
Exceptions
T:System.ArgumentNullExceptionassemblyName is null.
T:System.IO.FileNotFoundExceptionThe assembly specified by assemblyName is not found.
T:System.IO.FileLoadExceptionThe assembly specified by assemblyName was found, but could not be loaded.
T:System.BadImageFormatExceptionThe assembly specified by assemblyName is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyName was compiled with a later version.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.MissingMethodExceptionThe specified assembly has no entry point.

Definition at line 2177 of file AppDomain.cs.

◆ ExecuteAssemblyByName() [3/6]

int System.AppDomain.ExecuteAssemblyByName ( string  assemblyName,
Evidence  assemblySecurity,
params string []  args 
)

Executes the assembly given its display name, using the specified evidence and arguments.

Parameters
assemblyNameThe display name of the assembly. See P:System.Reflection.Assembly.FullName.
assemblySecurityEvidence for loading the assembly.
argsCommand-line arguments to pass when starting the process.
Returns
The value returned by the entry point of the assembly.
Exceptions
T:System.ArgumentNullExceptionassemblyName is null.
T:System.IO.FileNotFoundExceptionThe assembly specified by assemblyName is not found.
T:System.IO.FileLoadExceptionThe assembly specified by assemblyName was found, but could not be loaded.
T:System.BadImageFormatExceptionThe assembly specified by assemblyName is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyName was compiled with a later version.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.NotSupportedExceptionassemblySecurity is not null. When legacy CAS policy is not enabled, assemblySecurity should be null.
T:System.MissingMethodExceptionThe specified assembly has no entry point.

Definition at line 2198 of file AppDomain.cs.

◆ ExecuteAssemblyByName() [4/6]

int System.AppDomain.ExecuteAssemblyByName ( string  assemblyName,
params string []  args 
)

Executes the assembly given its display name, using the specified arguments.

Parameters
assemblyNameThe display name of the assembly. See P:System.Reflection.Assembly.FullName.
argsCommand-line arguments to pass when starting the process.
Returns
The value that is returned by the entry point of the assembly.
Exceptions
T:System.ArgumentNullExceptionassemblyName is null.
T:System.IO.FileNotFoundExceptionThe assembly specified by assemblyName is not found.
T:System.IO.FileLoadExceptionThe assembly specified by assemblyName was found, but could not be loaded.
T:System.BadImageFormatExceptionThe assembly specified by assemblyName is not a valid assembly. -or- assemblyName was compiled with a later version of the common language runtime than the version that is currently loaded.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.MissingMethodExceptionThe specified assembly has no entry point.

Definition at line 2225 of file AppDomain.cs.

◆ ExecuteAssemblyByName() [5/6]

int System.AppDomain.ExecuteAssemblyByName ( AssemblyName  assemblyName,
Evidence  assemblySecurity,
params string []  args 
)

Executes the assembly given an T:System.Reflection.AssemblyName, using the specified evidence and arguments.

Parameters
assemblyNameAn T:System.Reflection.AssemblyName object representing the name of the assembly.
assemblySecurityEvidence for loading the assembly.
argsCommand-line arguments to pass when starting the process.
Returns
The value returned by the entry point of the assembly.
Exceptions
T:System.IO.FileNotFoundExceptionThe assembly specified by assemblyName is not found.
T:System.IO.FileLoadExceptionThe assembly specified by assemblyName was found, but could not be loaded.
T:System.BadImageFormatExceptionThe assembly specified by assemblyName is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyName was compiled with a later version.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.NotSupportedExceptionassemblySecurity is not null. When legacy CAS policy is not enabled, assemblySecurity should be null.
T:System.MissingMethodExceptionThe specified assembly has no entry point.

Definition at line 2249 of file AppDomain.cs.

◆ ExecuteAssemblyByName() [6/6]

int System.AppDomain.ExecuteAssemblyByName ( AssemblyName  assemblyName,
params string []  args 
)

Executes the assembly given an T:System.Reflection.AssemblyName, using the specified arguments.

Parameters
assemblyNameAn T:System.Reflection.AssemblyName object representing the name of the assembly.
argsCommand-line arguments to pass when starting the process.
Returns
The value that is returned by the entry point of the assembly.
Exceptions
T:System.IO.FileNotFoundExceptionThe assembly specified by assemblyName is not found.
T:System.IO.FileLoadExceptionThe assembly specified by assemblyName was found, but could not be loaded.
T:System.BadImageFormatExceptionThe assembly specified by assemblyName is not a valid assembly. -or- assemblyName was compiled with a later version of the common language runtime than the version that is currently loaded.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.MissingMethodExceptionThe specified assembly has no entry point.

Definition at line 2274 of file AppDomain.cs.

◆ GetAssemblies()

Assembly [] System.AppDomain.GetAssemblies ( )

Gets the assemblies that have been loaded into the execution context of this application domain.

Returns
An array of assemblies in this application domain.
Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Implements System._AppDomain.

Definition at line 2325 of file AppDomain.cs.

◆ GetCurrentThreadId()

static int System.AppDomain.GetCurrentThreadId ( )

Gets the current thread identifier.

Returns
A 32-bit signed integer that is the identifier of the current thread.

◆ GetData()

object System.AppDomain.GetData ( string  name)

Gets the value stored in the current application domain for the specified name.

Parameters
nameThe name of a predefined application domain property, or the name of an application domain property you have defined.
Returns
The value of the name property, or null if the property does not exist.
Exceptions
T:System.ArgumentNullExceptionname is null.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Implements System._AppDomain.

Definition at line 2542 of file AppDomain.cs.

◆ GetType()

new Type System.AppDomain.GetType ( )

Gets the type of the current instance.

Returns
The type of the current instance.

Implements System._AppDomain.

Definition at line 4008 of file AppDomain.cs.

◆ InitializeLifetimeService()

override object System.AppDomain.InitializeLifetimeService ( )

Gives the T:System.AppDomain an infinite lifetime by preventing a lease from being created.

Returns
Always null.
Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Implements System._AppDomain.

Definition at line 2723 of file AppDomain.cs.

◆ IsCompatibilitySwitchSet()

bool? System.AppDomain.IsCompatibilitySwitchSet ( string  value)

Gets a nullable Boolean value that indicates whether any compatibility switches are set, and if so, whether the specified compatibility switch is set.

Parameters
valueThe compatibility switch to test.
Returns
A null reference (Nothing in Visual Basic) if no compatibility switches are set; otherwise, a Boolean value that indicates whether the compatibility switch that is specified by value is set.

Definition at line 2612 of file AppDomain.cs.

◆ IsDefaultAppDomain()

bool System.AppDomain.IsDefaultAppDomain ( )

Returns a value that indicates whether the application domain is the default application domain for the process.

Returns
true if the current T:System.AppDomain object represents the default application domain for the process; otherwise, false.

Definition at line 3949 of file AppDomain.cs.

◆ IsFinalizingForUnload()

bool System.AppDomain.IsFinalizingForUnload ( )

Indicates whether this application domain is unloading, and the objects it contains are being finalized by the common language runtime.

Returns
true if this application domain is unloading and the common language runtime has started invoking finalizers; otherwise, false.

◆ Load() [1/7]

Assembly System.AppDomain.Load ( AssemblyName  assemblyRef)

Loads an T:System.Reflection.Assembly given its T:System.Reflection.AssemblyName.

Parameters
assemblyRefAn object that describes the assembly to load.
Returns
The loaded assembly.
Exceptions
T:System.ArgumentNullExceptionassemblyRef is null.
T:System.IO.FileNotFoundExceptionassemblyRef is not found.
T:System.BadImageFormatExceptionassemblyRef is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyRef was compiled with a later version.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.

Implements System._AppDomain.

Definition at line 1863 of file AppDomain.cs.

◆ Load() [2/7]

Assembly System.AppDomain.Load ( string  assemblyString)

Loads an T:System.Reflection.Assembly given its display name.

Parameters
assemblyStringThe display name of the assembly. See P:System.Reflection.Assembly.FullName.
Returns
The loaded assembly.
Exceptions
T:System.ArgumentNullExceptionassemblyString is null
T:System.IO.FileNotFoundExceptionassemblyString is not found.
T:System.BadImageFormatExceptionassemblyString is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyString was compiled with a later version.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.

Implements System._AppDomain.

Definition at line 1882 of file AppDomain.cs.

◆ Load() [3/7]

Assembly System.AppDomain.Load ( byte []  rawAssembly)

Loads the T:System.Reflection.Assembly with a common object file format (COFF) based image containing an emitted T:System.Reflection.Assembly.

Parameters
rawAssemblyAn array of type byte that is a COFF-based image containing an emitted assembly.
Returns
The loaded assembly.
Exceptions
T:System.ArgumentNullExceptionrawAssembly is null.
T:System.BadImageFormatExceptionrawAssembly is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and rawAssembly was compiled with a later version.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.

Implements System._AppDomain.

Definition at line 1899 of file AppDomain.cs.

◆ Load() [4/7]

Assembly System.AppDomain.Load ( byte []  rawAssembly,
byte []  rawSymbolStore 
)

Loads the T:System.Reflection.Assembly with a common object file format (COFF) based image containing an emitted T:System.Reflection.Assembly. The raw bytes representing the symbols for the T:System.Reflection.Assembly are also loaded.

Parameters
rawAssemblyAn array of type byte that is a COFF-based image containing an emitted assembly.
rawSymbolStoreAn array of type byte containing the raw bytes representing the symbols for the assembly.
Returns
The loaded assembly.
Exceptions
T:System.ArgumentNullExceptionrawAssembly is null.
T:System.BadImageFormatExceptionrawAssembly is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and rawAssembly was compiled with a later version.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.

Implements System._AppDomain.

Definition at line 1917 of file AppDomain.cs.

◆ Load() [5/7]

Assembly System.AppDomain.Load ( byte []  rawAssembly,
byte []  rawSymbolStore,
Evidence  securityEvidence 
)

Loads the T:System.Reflection.Assembly with a common object file format (COFF) based image containing an emitted T:System.Reflection.Assembly. The raw bytes representing the symbols for the T:System.Reflection.Assembly are also loaded.

Parameters
rawAssemblyAn array of type byte that is a COFF-based image containing an emitted assembly.
rawSymbolStoreAn array of type byte containing the raw bytes representing the symbols for the assembly.
securityEvidenceEvidence for loading the assembly.
Returns
The loaded assembly.
Exceptions
T:System.ArgumentNullExceptionrawAssembly is null.
T:System.BadImageFormatExceptionrawAssembly is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and rawAssembly was compiled with a later version.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.
T:System.NotSupportedExceptionsecurityEvidence is not null. When legacy CAS policy is not enabled, securityEvidence should be null.

Implements System._AppDomain.

Definition at line 1940 of file AppDomain.cs.

◆ Load() [6/7]

Assembly System.AppDomain.Load ( AssemblyName  assemblyRef,
Evidence  assemblySecurity 
)

Loads an T:System.Reflection.Assembly given its T:System.Reflection.AssemblyName.

Parameters
assemblyRefAn object that describes the assembly to load.
assemblySecurityEvidence for loading the assembly.
Returns
The loaded assembly.
Exceptions
T:System.ArgumentNullExceptionassemblyRef is null
T:System.IO.FileNotFoundExceptionassemblyRef is not found.
T:System.BadImageFormatExceptionassemblyRef is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyRef was compiled with a later version.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.

Implements System._AppDomain.

Definition at line 1965 of file AppDomain.cs.

◆ Load() [7/7]

Assembly System.AppDomain.Load ( string  assemblyString,
Evidence  assemblySecurity 
)

Loads an T:System.Reflection.Assembly given its display name.

Parameters
assemblyStringThe display name of the assembly. See P:System.Reflection.Assembly.FullName.
assemblySecurityEvidence for loading the assembly.
Returns
The loaded assembly.
Exceptions
T:System.ArgumentNullExceptionassemblyString is null
T:System.IO.FileNotFoundExceptionassemblyString is not found.
T:System.BadImageFormatExceptionassemblyString is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and assemblyString was compiled with a later version.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different evidences.

Implements System._AppDomain.

Definition at line 1986 of file AppDomain.cs.

◆ ReflectionOnlyGetAssemblies()

Assembly [] System.AppDomain.ReflectionOnlyGetAssemblies ( )

Returns the assemblies that have been loaded into the reflection-only context of the application domain.

Returns
An array of T:System.Reflection.Assembly objects that represent the assemblies loaded into the reflection-only context of the application domain.
Exceptions
T:System.AppDomainUnloadedExceptionAn operation is attempted on an unloaded application domain.

Definition at line 2333 of file AppDomain.cs.

◆ SetAppDomainPolicy()

void System.AppDomain.SetAppDomainPolicy ( PolicyLevel  domainPolicy)

Establishes the security policy level for this application domain.

Parameters
domainPolicyThe security policy level.
Exceptions
T:System.ArgumentNullExceptiondomainPolicy is null.
T:System.Security.Policy.PolicyExceptionThe security policy level has already been set.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Implements System._AppDomain.

Definition at line 2663 of file AppDomain.cs.

◆ SetCachePath()

void System.AppDomain.SetCachePath ( string  path)

Establishes the specified directory path as the location where assemblies are shadow copied.

Parameters
pathThe fully qualified path to the shadow copy location.
Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Implements System._AppDomain.

Definition at line 2406 of file AppDomain.cs.

◆ SetData() [1/2]

void System.AppDomain.SetData ( string  name,
object  data 
)

Assigns the specified value to the specified application domain property.

Parameters
nameThe name of a user-defined application domain property to create or change.
dataThe value of the property.
Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Implements System._AppDomain.

Definition at line 2416 of file AppDomain.cs.

◆ SetData() [2/2]

void System.AppDomain.SetData ( string  name,
object  data,
IPermission  permission 
)

Assigns the specified value to the specified application domain property, with a specified permission to demand of the caller when the property is retrieved.

Parameters
nameThe name of a user-defined application domain property to create or change.
dataThe value of the property.
permissionThe permission to demand of the caller when the property is retrieved.
Exceptions
T:System.ArgumentNullExceptionname is null.
T:System.InvalidOperationExceptionname specifies a system-defined property string and permission is not null.

Definition at line 2430 of file AppDomain.cs.

◆ SetDynamicBase()

void System.AppDomain.SetDynamicBase ( string  path)

Establishes the specified directory path as the base directory for subdirectories where dynamically generated files are stored and accessed.

Parameters
pathThe fully qualified path that is the base directory for subdirectories where dynamic assemblies are stored.
Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Definition at line 3622 of file AppDomain.cs.

◆ SetPrincipalPolicy()

void System.AppDomain.SetPrincipalPolicy ( PrincipalPolicy  policy)

Specifies how principal and identity objects should be attached to a thread if the thread attempts to bind to a principal while executing in this application domain.

Parameters
policyOne of the T:System.Security.Principal.PrincipalPolicy values that specifies the type of the principal object to attach to threads.
Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Implements System._AppDomain.

Definition at line 2714 of file AppDomain.cs.

◆ SetShadowCopyFiles()

void System.AppDomain.SetShadowCopyFiles ( )

Turns on shadow copying.

Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Definition at line 3612 of file AppDomain.cs.

◆ SetShadowCopyPath()

void System.AppDomain.SetShadowCopyPath ( string  path)

Establishes the specified directory path as the location of assemblies to be shadow copied.

Parameters
pathA list of directory names, where each name is separated by a semicolon.
Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Implements System._AppDomain.

Definition at line 3603 of file AppDomain.cs.

◆ SetThreadPrincipal()

void System.AppDomain.SetThreadPrincipal ( IPrincipal  principal)

Sets the default principal object to be attached to threads if they attempt to bind to a principal while executing in this application domain.

Parameters
principalThe principal object to attach to threads.
Exceptions
T:System.ArgumentNullExceptionprincipal is null.
T:System.Security.Policy.PolicyExceptionThe thread principal has already been set.
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Implements System._AppDomain.

Definition at line 2693 of file AppDomain.cs.

◆ ToString()

override string System.AppDomain.ToString ( )

Obtains a string representation that includes the friendly name of the application domain and any context policies.

Returns
A string formed by concatenating the literal string "Name:", the friendly name of the application domain, and either string representations of the context policies or the string "There are no context policies."
Exceptions
T:System.AppDomainUnloadedExceptionThe application domain represented by the current T:System.AppDomain has been unloaded.

Implements System._AppDomain.

Definition at line 2297 of file AppDomain.cs.

◆ Unload()

static void System.AppDomain.Unload ( AppDomain  domain)
static

Unloads the specified application domain.

Parameters
domainAn application domain to unload.
Exceptions
T:System.ArgumentNullExceptiondomain is null.
T:System.CannotUnloadAppDomainExceptiondomain could not be unloaded.
T:System.ExceptionAn error occurred during the unload process.

Definition at line 2634 of file AppDomain.cs.

Member Data Documentation

◆ BaseDirectory

string System.AppDomain.BaseDirectory => FusionStore.ApplicationBase

Gets the base directory that the assembly resolver uses to probe for assemblies.

Returns
The base directory that the assembly resolver uses to probe for assemblies.
Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Definition at line 323 of file AppDomain.cs.

◆ CurrentDomain

AppDomain System.AppDomain.CurrentDomain => Thread.GetDomain()
static

Gets the current application domain for the current T:System.Threading.Thread.

Returns
The current application domain.

Definition at line 274 of file AppDomain.cs.

◆ RelativeSearchPath

string System.AppDomain.RelativeSearchPath => FusionStore.PrivateBinPath

Gets the path under the base directory where the assembly resolver should probe for private assemblies.

Returns
The path under the base directory where the assembly resolver should probe for private assemblies.
Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Definition at line 328 of file AppDomain.cs.

◆ SetupInformation

AppDomainSetup System.AppDomain.SetupInformation => new AppDomainSetup(FusionStore, copyDomainBoundData: true)

Gets the application domain configuration information for this instance.

Returns
The application domain initialization information.
Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Definition at line 431 of file AppDomain.cs.

Property Documentation

◆ ActivationContext

ActivationContext System.AppDomain.ActivationContext
get

Gets the activation context for the current application domain.

Returns
An object that represents the activation context for the current application domain, or null if the domain has no activation context.

Definition at line 350 of file AppDomain.cs.

◆ ApplicationIdentity

ApplicationIdentity System.AppDomain.ApplicationIdentity
get

Gets the identity of the application in the application domain.

Returns
An object that identifies the application in the application domain.

Definition at line 361 of file AppDomain.cs.

◆ ApplicationTrust

ApplicationTrust System.AppDomain.ApplicationTrust
get

Gets information describing permissions granted to an application and whether the application has a trust level that allows it to run.

Returns
An object that encapsulates permission and trust information for the application in the application domain.

Definition at line 372 of file AppDomain.cs.

◆ AssemblyResolve

ResolveEventHandler System.AppDomain.AssemblyResolve
addremove

Occurs when the resolution of an assembly fails.

Definition at line 638 of file AppDomain.cs.

◆ DomainManager

AppDomainManager System.AppDomain.DomainManager
get

Gets the domain manager that was provided by the host when the application domain was initialized.

Returns
An object that represents the domain manager provided by the host when the application domain was initialized, or null if no domain manager was provided.

Definition at line 245 of file AppDomain.cs.

◆ DomainUnload

EventHandler System.AppDomain.DomainUnload
addremove

Occurs when an T:System.AppDomain is about to be unloaded.

Definition at line 687 of file AppDomain.cs.

◆ DynamicDirectory

string System.AppDomain.DynamicDirectory
get

Gets the directory that the assembly resolver uses to probe for dynamically created assemblies.

Returns
The directory that the assembly resolver uses to probe for dynamically created assemblies.
Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Definition at line 388 of file AppDomain.cs.

◆ Evidence

Evidence System.AppDomain.Evidence
get

Gets the T:System.Security.Policy.Evidence associated with this application domain.

Returns
The evidence associated with this application domain.
Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Definition at line 280 of file AppDomain.cs.

◆ FirstChanceException

EventHandler<FirstChanceExceptionEventArgs> System.AppDomain.FirstChanceException
addremove

Occurs when an exception is thrown in managed code, before the runtime searches the call stack for an exception handler in the application domain.

Definition at line 736 of file AppDomain.cs.

◆ FriendlyName

string System.AppDomain.FriendlyName
get

Gets the friendly name of this application domain.

Returns
The friendly name of this application domain.
Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Definition at line 312 of file AppDomain.cs.

◆ Id

int System.AppDomain.Id
get

Gets an integer that uniquely identifies the application domain within the process.

Returns
An integer that identifies the application domain.

Definition at line 491 of file AppDomain.cs.

◆ IsFullyTrusted

bool??? System.AppDomain.IsFullyTrusted
get

Gets a value that indicates whether assemblies that are loaded into the current application domain execute with full trust.

Returns
true if assemblies that are loaded into the current application domain execute with full trust; otherwise, false.

Definition at line 454 of file AppDomain.cs.

◆ IsHomogenous

bool System.AppDomain.IsHomogenous
get

Gets a value that indicates whether the current application domain has a set of permissions that is granted to all assemblies that are loaded into the application domain.

Returns
true if the current application domain has a homogenous set of permissions; otherwise, false.

Definition at line 468 of file AppDomain.cs.

◆ MonitoringIsEnabled

bool System.AppDomain.MonitoringIsEnabled
staticgetset

Gets or sets a value that indicates whether CPU and memory monitoring of application domains is enabled for the current process. Once monitoring is enabled for a process, it cannot be disabled.

Returns
true if monitoring is enabled; otherwise false.
Exceptions
T:System.ArgumentExceptionThe current process attempted to assign the value false to this property.

Definition at line 504 of file AppDomain.cs.

◆ MonitoringSurvivedMemorySize

long System.AppDomain.MonitoringSurvivedMemorySize
get

Gets the number of bytes that survived the last collection and that are known to be referenced by the current application domain.

Returns
The number of surviving bytes.
Exceptions
T:System.InvalidOperationExceptionThe static (Shared in Visual Basic) P:System.AppDomain.MonitoringIsEnabled property is set to false.

Definition at line 560 of file AppDomain.cs.

◆ MonitoringSurvivedProcessMemorySize

long System.AppDomain.MonitoringSurvivedProcessMemorySize
staticget

Gets the total bytes that survived from the last collection for all application domains in the process.

Returns
The total number of surviving bytes for the process.
Exceptions
T:System.InvalidOperationExceptionThe static (Shared in Visual Basic) P:System.AppDomain.MonitoringIsEnabled property is set to false.

Definition at line 577 of file AppDomain.cs.

◆ MonitoringTotalAllocatedMemorySize

long System.AppDomain.MonitoringTotalAllocatedMemorySize
get

Gets the total size, in bytes, of all memory allocations that have been made by the application domain since it was created, without subtracting memory that has been collected.

Returns
The total size of all memory allocations.
Exceptions
T:System.InvalidOperationExceptionThe static (Shared in Visual Basic) P:System.AppDomain.MonitoringIsEnabled property is set to false.

Definition at line 542 of file AppDomain.cs.

◆ MonitoringTotalProcessorTime

TimeSpan System.AppDomain.MonitoringTotalProcessorTime
get

Gets the total processor time that has been used by all threads while executing in the current application domain, since the process started.

Returns
Total processor time for the current application domain.
Exceptions
T:System.InvalidOperationExceptionThe static (Shared in Visual Basic) P:System.AppDomain.MonitoringIsEnabled property is set to false.

Definition at line 525 of file AppDomain.cs.

◆ PermissionSet

PermissionSet System.AppDomain.PermissionSet
get

Gets the permission set of a sandboxed application domain.

Returns
The permission set of the sandboxed application domain.

Definition at line 436 of file AppDomain.cs.

◆ ProcessExit

EventHandler System.AppDomain.ProcessExit
addremove

Occurs when the default application domain's parent process exits.

Definition at line 663 of file AppDomain.cs.

◆ ResourceResolve

ResolveEventHandler System.AppDomain.ResourceResolve
addremove

Occurs when the resolution of a resource fails because the resource is not a valid linked or embedded resource in the assembly.

Definition at line 617 of file AppDomain.cs.

◆ ShadowCopyFiles

bool System.AppDomain.ShadowCopyFiles
get

Gets an indication whether the application domain is configured to shadow copy files.

Returns
true if the application domain is configured to shadow copy files; otherwise, false.
Exceptions
T:System.AppDomainUnloadedExceptionThe operation is attempted on an unloaded application domain.

Definition at line 335 of file AppDomain.cs.

◆ TypeResolve

ResolveEventHandler System.AppDomain.TypeResolve
addremove

Occurs when the resolution of a type fails.

Definition at line 596 of file AppDomain.cs.

◆ UnhandledException

UnhandledExceptionEventHandler System.AppDomain.UnhandledException
addremove

Occurs when an exception is not caught.

Definition at line 711 of file AppDomain.cs.

Event Documentation

◆ AssemblyLoad

AssemblyLoadEventHandler System.AppDomain.AssemblyLoad

Occurs when an assembly is loaded.

Definition at line 592 of file AppDomain.cs.

◆ ReflectionOnlyAssemblyResolve

ResolveEventHandler System.AppDomain.ReflectionOnlyAssemblyResolve

Occurs when the resolution of an assembly fails in the reflection-only context.

Definition at line 659 of file AppDomain.cs.


The documentation for this class was generated from the following file: