Bagikan melalui


AppDomain Class

Microsoft Silverlight will reach end of support after October 2021. Learn more.

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

Inheritance Hierarchy

System.Object
  System.AppDomain

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
<ComVisibleAttribute(True)> _
<ClassInterfaceAttribute(ClassInterfaceType.None)> _
Public NotInheritable Class AppDomain
[ComVisibleAttribute(true)]
[ClassInterfaceAttribute(ClassInterfaceType.None)]
public sealed class AppDomain

The AppDomain type exposes the following members.

Properties

  Name Description
Public propertyStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360 CurrentDomain Gets the current application domain for the current Thread.
Public propertySupported by Silverlight for Windows PhoneSupported by Xbox 360 DomainManager Gets the domain manager that was provided by the host when the application domain was initialized.
Public propertySupported by Silverlight for Windows PhoneSupported by Xbox 360 FriendlyName Gets the friendly name of this application domain.
Public property IsFullyTrusted Gets a value that indicates whether assemblies that are loaded into the current application domain execute with full trust.

Top

Methods

  Name Description
Public method DefineDynamicAssembly Defines a dynamic assembly with the specified name and access mode.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method ExecuteAssemblyByName Security Critical. Executes an assembly given its display name.
Protected methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 Finalize Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone GetAssemblies Gets the assemblies that have been loaded into the execution context of this application domain.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 GetType Gets the type of the current instance.
Public method IsCompatibilitySwitchSet Gets a nullable Boolean value that indicates whether any compatibility switches are set, and if so, whether the specified compatibility switch is set.
Protected methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 ToString Obtains a string representation that includes the friendly name of the application domain and any context policies. (Overrides Object.ToString().)

Top

Events

  Name Description
Public event AssemblyResolve Occurs when the resolution of an assembly fails.
Public eventSupported by Silverlight for Windows PhoneSupported by Xbox 360 UnhandledException Occurs when an exception is not caught.

Top

Remarks

Application domains, which are represented by AppDomain objects, help provide isolation, unloading, and security boundaries for executing managed code. A Silverlight application has only one application domain.

If an assembly is loaded into the default application domain, it cannot be unloaded from memory while the process is running.

Topic Location
How to: Configure an Application Domain .NET Framework: Programming Fundamentals
How to: Load Assemblies into an Application Domain .NET Framework: Programming Fundamentals
How to: Create an Application Domain .NET Framework: Programming Fundamentals
How to: Unload an Application Domain .NET Framework: Programming Fundamentals
How to: Configure an Application Domain .NET Framework: Programming Fundamentals
How to: Load Assemblies into an Application Domain .NET Framework: Programming Fundamentals
How to: Create an Application Domain .NET Framework: Programming Fundamentals
How to: Unload an Application Domain .NET Framework: Programming Fundamentals
How to: Configure an Application Domain .NET Framework: Programming Fundamentals
How to: Load Assemblies into an Application Domain .NET Framework: Programming Fundamentals
How to: Create an Application Domain .NET Framework: Programming Fundamentals
How to: Unload an Application Domain .NET Framework: Programming Fundamentals

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference