AppDomain AppDomain AppDomain AppDomain Class

定义

表示应用程序域,它是一个应用程序在其中执行的独立环境。Represents an application domain, which is an isolated environment where applications execute. 此类不能被继承。This class cannot be inherited.

public ref class AppDomain sealed : MarshalByRefObject, _AppDomain, System::Security::IEvidenceFactory
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class AppDomain : MarshalByRefObject, _AppDomain, System.Security.IEvidenceFactory
type AppDomain = class
    inherit MarshalByRefObject
    interface _AppDomain
    interface IEvidenceFactory
Public NotInheritable Class AppDomain
Inherits MarshalByRefObject
Implements _AppDomain, IEvidenceFactory
继承
属性
实现

示例

此示例演示如何创建一个新AppDomain,实例化类型中的新AppDomain,并与该类型的对象进行通信。This example shows how to create a new AppDomain, instantiate a type in that new AppDomain, and communicate with that type's object. 此外,此示例演示如何卸载AppDomain导致要进行垃圾回收的对象。In addition, this example shows how to unload the AppDomain causing the object to be garbage collected.

using namespace System;
using namespace System::Reflection;
using namespace System::Threading;
using namespace System::Security::Policy;

// Because this class is derived from MarshalByRefObject, a proxy 
// to a MarshalByRefType object can be returned across an AppDomain 
// boundary.
ref class MarshalByRefType : MarshalByRefObject
{
public:
    //  Call this method via a proxy.
    void SomeMethod(String^ callingDomainName)
    {
        // Get this AppDomain's settings and display some of them.
        AppDomainSetup^ ads = AppDomain::CurrentDomain->SetupInformation;
        Console::WriteLine("AppName={0}, AppBase={1}, ConfigFile={2}", 
            ads->ApplicationName, 
            ads->ApplicationBase, 
            ads->ConfigurationFile
        );

        // Display the name of the calling AppDomain and the name 
        // of the second domain.
        // NOTE: The application's thread has transitioned between 
        // AppDomains.
        Console::WriteLine("Calling from '{0}' to '{1}'.", 
            callingDomainName, 
            Thread::GetDomain()->FriendlyName
        );
    };
};

void main()
{
    // Get and display the friendly name of the default AppDomain.
    String^ callingDomainName = Thread::GetDomain()->FriendlyName;
    Console::WriteLine(callingDomainName);

    // Get and display the full name of the EXE assembly.
    String^ exeAssembly = Assembly::GetEntryAssembly()->FullName;
    Console::WriteLine(exeAssembly);

    // Construct and initialize settings for a second AppDomain.
    AppDomainSetup^ ads = gcnew AppDomainSetup();
    ads->ApplicationBase = AppDomain::CurrentDomain->BaseDirectory;

    ads->DisallowBindingRedirects = false;
    ads->DisallowCodeDownload = true;
    ads->ConfigurationFile = 
        AppDomain::CurrentDomain->SetupInformation->ConfigurationFile;

    // Create the second AppDomain.
    AppDomain^ ad2 = AppDomain::CreateDomain("AD #2", 
        AppDomain::CurrentDomain->Evidence, ads);

    // Create an instance of MarshalbyRefType in the second AppDomain. 
    // A proxy to the object is returned.
    MarshalByRefType^ mbrt = 
        (MarshalByRefType^) ad2->CreateInstanceAndUnwrap(
            exeAssembly, 
            MarshalByRefType::typeid->FullName
        );

    // Call a method on the object via the proxy, passing the 
    // default AppDomain's friendly name in as a parameter.
    mbrt->SomeMethod(callingDomainName);

    // Unload the second AppDomain. This deletes its object and 
    // invalidates the proxy object.
    AppDomain::Unload(ad2);
    try
    {
        // Call the method again. Note that this time it fails 
        // because the second AppDomain was unloaded.
        mbrt->SomeMethod(callingDomainName);
        Console::WriteLine("Sucessful call.");
    }
    catch(AppDomainUnloadedException^)
    {
        Console::WriteLine("Failed call; this is expected.");
    }
}

/* This code produces output similar to the following: 

AppDomainX.exe
AppDomainX, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
AppName=, AppBase=C:\AppDomain\bin, ConfigFile=C:\AppDomain\bin\AppDomainX.exe.config
Calling from 'AppDomainX.exe' to 'AD #2'.
Failed call; this is expected.
 */
using System;
using System.Reflection;
using System.Threading;

class Module1
{
    public static void Main()
    {
        // Get and display the friendly name of the default AppDomain.
        string callingDomainName = Thread.GetDomain().FriendlyName;
        Console.WriteLine(callingDomainName);

        // Get and display the full name of the EXE assembly.
        string exeAssembly = Assembly.GetEntryAssembly().FullName;
        Console.WriteLine(exeAssembly);

        // Construct and initialize settings for a second AppDomain.
        AppDomainSetup ads = new AppDomainSetup();
        ads.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;

        ads.DisallowBindingRedirects = false;
        ads.DisallowCodeDownload = true;
        ads.ConfigurationFile = 
            AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;

        // Create the second AppDomain.
        AppDomain ad2 = AppDomain.CreateDomain("AD #2", null, ads);

        // Create an instance of MarshalbyRefType in the second AppDomain. 
        // A proxy to the object is returned.
        MarshalByRefType mbrt = 
            (MarshalByRefType) ad2.CreateInstanceAndUnwrap(
                exeAssembly, 
                typeof(MarshalByRefType).FullName
            );

        // Call a method on the object via the proxy, passing the 
        // default AppDomain's friendly name in as a parameter.
        mbrt.SomeMethod(callingDomainName);

        // Unload the second AppDomain. This deletes its object and 
        // invalidates the proxy object.
        AppDomain.Unload(ad2);
        try
        {
            // Call the method again. Note that this time it fails 
            // because the second AppDomain was unloaded.
            mbrt.SomeMethod(callingDomainName);
            Console.WriteLine("Sucessful call.");
        }
        catch(AppDomainUnloadedException)
        {
            Console.WriteLine("Failed call; this is expected.");
        }
    }
}

// Because this class is derived from MarshalByRefObject, a proxy 
// to a MarshalByRefType object can be returned across an AppDomain 
// boundary.
public class MarshalByRefType : MarshalByRefObject
{
    //  Call this method via a proxy.
    public void SomeMethod(string callingDomainName)
    {
        // Get this AppDomain's settings and display some of them.
        AppDomainSetup ads = AppDomain.CurrentDomain.SetupInformation;
        Console.WriteLine("AppName={0}, AppBase={1}, ConfigFile={2}", 
            ads.ApplicationName, 
            ads.ApplicationBase, 
            ads.ConfigurationFile
        );

        // Display the name of the calling AppDomain and the name 
        // of the second domain.
        // NOTE: The application's thread has transitioned between 
        // AppDomains.
        Console.WriteLine("Calling from '{0}' to '{1}'.", 
            callingDomainName, 
            Thread.GetDomain().FriendlyName
        );
    }
}

/* This code produces output similar to the following: 

AppDomainX.exe
AppDomainX, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
AppName=, AppBase=C:\AppDomain\bin, ConfigFile=C:\AppDomain\bin\AppDomainX.exe.config
Calling from 'AppDomainX.exe' to 'AD #2'.
Failed call; this is expected.
 */
Imports System
Imports System.Reflection
Imports System.Threading

Module Module1
    Sub Main()

        ' Get and display the friendly name of the default AppDomain.
        Dim callingDomainName As String = Thread.GetDomain().FriendlyName
        Console.WriteLine(callingDomainName)

        ' Get and display the full name of the EXE assembly.
        Dim exeAssembly As String = [Assembly].GetEntryAssembly().FullName
        Console.WriteLine(exeAssembly)

        ' Construct and initialize settings for a second AppDomain.
        Dim ads As New AppDomainSetup()
        ads.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory
        ads.DisallowBindingRedirects = False
        ads.DisallowCodeDownload = True
        ads.ConfigurationFile = _
            AppDomain.CurrentDomain.SetupInformation.ConfigurationFile

        ' Create the second AppDomain.
        Dim ad2 As AppDomain = AppDomain.CreateDomain("AD #2", Nothing, ads)

        ' Create an instance of MarshalbyRefType in the second AppDomain. 
        ' A proxy to the object is returned.
        Dim mbrt As MarshalByRefType = CType( _
            ad2.CreateInstanceAndUnwrap(exeAssembly, _
                 GetType(MarshalByRefType).FullName), MarshalByRefType)

        ' Call a method on the object via the proxy, passing the default 
        ' AppDomain's friendly name in as a parameter.
        mbrt.SomeMethod(callingDomainName)

        ' Unload the second AppDomain. This deletes its object and 
        ' invalidates the proxy object.
        AppDomain.Unload(ad2)
        Try
            ' Call the method again. Note that this time it fails because 
            ' the second AppDomain was unloaded.
            mbrt.SomeMethod(callingDomainName)
            Console.WriteLine("Sucessful call.")
        Catch e As AppDomainUnloadedException
            Console.WriteLine("Failed call; this is expected.")
        End Try

    End Sub
End Module

' Because this class is derived from MarshalByRefObject, a proxy 
' to a MarshalByRefType object can be returned across an AppDomain 
' boundary.
Public Class MarshalByRefType
    Inherits MarshalByRefObject

    '  Call this method via a proxy.
    Public Sub SomeMethod(ByVal callingDomainName As String)

        ' Get this AppDomain's settings and display some of them.
        Dim ads As AppDomainSetup = AppDomain.CurrentDomain.SetupInformation
        Console.WriteLine("AppName={0}, AppBase={1}, ConfigFile={2}", _
            ads.ApplicationName, ads.ApplicationBase, ads.ConfigurationFile)

        ' Display the name of the calling AppDomain and the name 
        ' of the second domain.
        ' NOTE: The application's thread has transitioned between 
        ' AppDomains.
        Console.WriteLine("Calling from '{0}' to '{1}'.", _
            callingDomainName, Thread.GetDomain().FriendlyName)
    End Sub
End Class

'This code produces output similar to the following:
' 
' AppDomainX.exe
' AppDomainX, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
' AppName=, AppBase=C:\AppDomain\bin, ConfigFile=C:\AppDomain\bin\AppDomainX.exe.config
' Calling from 'AppDomainX.exe' to 'AD #2'.
' Failed call; this is expected.

注解

应用程序域,由表示AppDomain对象,可帮助为执行托管的代码提供隔离、 卸载和安全边界。Application domains, which are represented by AppDomain objects, help provide isolation, unloading, and security boundaries for executing managed code.

  • 使用应用程序域隔离可能会终止进程的任务。Use application domains to isolate tasks that might bring down a process. 如果状态AppDomain的正在执行的任务变得不稳定,AppDomain而不会影响该过程,可以卸载。If the state of the AppDomain that's executing a task becomes unstable, the AppDomain can be unloaded without affecting the process. 进程必须运行很长一段无需重新启动时,这很重要。This is important when a process must run for long periods without restarting. 此外可以使用应用程序域隔离不应共享数据的任务。You can also use application domains to isolate tasks that should not share data.

  • 如果程序集加载到默认应用程序域,它不能从内存中卸载进程运行时。If an assembly is loaded into the default application domain, it cannot be unloaded from memory while the process is running. 但是,如果您打开第二个应用程序域加载和执行程序集,程序集是卸载该应用程序域卸载时。However, if you open a second application domain to load and execute the assembly, the assembly is unloaded when that application domain is unloaded. 使用此方法最大程度减少偶尔使用大型 Dll 的长时间运行进程的工作集。Use this technique to minimize the working set of long-running processes that occasionally use large DLLs.

备注

.NET Core 上AppDomain实现设计受限制,它不提供隔离、 卸载或安全边界。On .NET Core, the AppDomain implementation is limited by design and does not provide isolation, unloading, or security boundaries. 对于.NET Core,是正好有一个AppDomainFor .NET Core, there is exactly one AppDomain. 通过提供隔离和卸载AssemblyLoadContextIsolation and unloading are provided through AssemblyLoadContext. 应由进程边界和相应的远程处理技术提供安全边界。Security boundaries should be provided by process boundaries and appropriate remoting techniques.

可以在单个进程; 中运行多个应用程序域但是,没有应用程序域和线程之间具有一对一的相关性。Multiple application domains can run in a single process; however, there is not a one-to-one correlation between application domains and threads. 多个线程可以属于单个应用程序域,并且给定的线程并不局限于单个应用程序域,在任何给定时间,而在单个应用程序域中执行一个线程。Several threads can belong to a single application domain, and while a given thread is not confined to a single application domain, at any given time, a thread executes in a single application domain.

使用创建应用程序域CreateDomain方法。Application domains are created using the CreateDomain method. AppDomain 使用实例来加载和执行程序集 (Assembly)。AppDomain instances are used to load and execute assemblies (Assembly). AppDomain是不能再在使用中,可能会被卸载。When an AppDomain is no longer in use, it can be unloaded.

AppDomain类实现一组事件,使应用程序进行响应时的应用程序域将被卸载,加载程序集或引发未经处理的异常。The AppDomain class implements a set of events that enable applications to respond when an assembly is loaded, when an application domain will be unloaded, or when an unhandled exception is thrown.

使用应用程序域的详细信息,请参阅应用程序域For more information on using application domains, see Application Domains.

此类实现MarshalByRefObject_AppDomain,和IEvidenceFactory接口。This class implements the MarshalByRefObject, _AppDomain, and IEvidenceFactory interfaces.

决不要创建的可远程处理包装AppDomain对象。You should never create a remotable wrapper for an AppDomain object. 执行此操作可以将发布到的远程引用AppDomain,如公开方法CreateInstance远程访问和有效地销毁该代码访问安全性AppDomainDoing so could publish a remote reference to that AppDomain, exposing methods such as CreateInstance to remote access and effectively destroying code access security for that AppDomain. 恶意客户端连接到远程AppDomain无法获取任何资源的访问权限AppDomain本身有权访问。Malicious clients connecting to the remoted AppDomain could obtain access to any resource the AppDomain itself has access to. 不要创建可远程处理的任何类型,将扩展包装MarshalByRefObject并实现恶意客户端无法用于绕过安全系统的方法。Do not create remotable wrappers for any type that extends MarshalByRefObject and that implements methods that could be used by malicious clients to bypass the security system.

注意

默认值为AppDomainSetup.DisallowCodeDownload属性是falseThe default value for the AppDomainSetup.DisallowCodeDownload property is false. 此设置是不安全的服务。This setting is unsafe for services. 若要防止服务下载部分受信任的代码,请将此属性设置为trueTo prevent services from downloading partially trusted code, set this property to true.

属性

ActivationContext ActivationContext ActivationContext ActivationContext

获取当前应用程序域的激活上下文。Gets the activation context for the current application domain.

ApplicationIdentity ApplicationIdentity ApplicationIdentity ApplicationIdentity

获得应用程序域中的应用程序标识。Gets the identity of the application in the application domain.

ApplicationTrust ApplicationTrust ApplicationTrust ApplicationTrust

获取说明授予应用程序的权限以及应用程序是否拥有允许其运行的信任级别的信息。Gets information describing permissions granted to an application and whether the application has a trust level that allows it to run.

BaseDirectory BaseDirectory BaseDirectory BaseDirectory

获取基目录,它由程序集冲突解决程序用来探测程序集。Gets the base directory that the assembly resolver uses to probe for assemblies.

CurrentDomain CurrentDomain CurrentDomain CurrentDomain

获取当前 Thread 的当前应用程序域。Gets the current application domain for the current Thread.

DomainManager DomainManager DomainManager DomainManager

获得初始化应用程序域时主机提供的域管理器。Gets the domain manager that was provided by the host when the application domain was initialized.

DynamicDirectory DynamicDirectory DynamicDirectory DynamicDirectory

获取目录,它由程序集冲突解决程序用来探测动态创建的程序集。Gets the directory that the assembly resolver uses to probe for dynamically created assemblies.

Evidence Evidence Evidence Evidence

获取与该应用程序域关联的 EvidenceGets the Evidence associated with this application domain.

FriendlyName FriendlyName FriendlyName FriendlyName

获取此应用程序域的友好名称。Gets the friendly name of this application domain.

Id Id Id Id

获得一个整数,该整数唯一标识进程中的应用程序域。Gets an integer that uniquely identifies the application domain within the process.

IsFullyTrusted IsFullyTrusted IsFullyTrusted IsFullyTrusted

获取一个值,该值指示加载到当前应用程序域的程序集是否是以完全信任方式执行的。Gets a value that indicates whether assemblies that are loaded into the current application domain execute with full trust.

IsHomogenous IsHomogenous IsHomogenous IsHomogenous

获取一个值,该值指示当前应用程序域是否拥有一个为加载到该应用程序域的所有程序集授予的权限集。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.

MonitoringIsEnabled MonitoringIsEnabled MonitoringIsEnabled MonitoringIsEnabled

获取或设置一个值,该值指示是否对当前进程启用应用程序域的 CPU 和内存监视。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.

MonitoringSurvivedMemorySize MonitoringSurvivedMemorySize MonitoringSurvivedMemorySize MonitoringSurvivedMemorySize

获取上次回收后保留下来的,已知由当前应用程序域引用的字节数。Gets the number of bytes that survived the last collection and that are known to be referenced by the current application domain.

MonitoringSurvivedProcessMemorySize MonitoringSurvivedProcessMemorySize MonitoringSurvivedProcessMemorySize MonitoringSurvivedProcessMemorySize

获取进程中所有应用程序域的上次回收后保留下来的总字节数。Gets the total bytes that survived from the last collection for all application domains in the process.

MonitoringTotalAllocatedMemorySize MonitoringTotalAllocatedMemorySize MonitoringTotalAllocatedMemorySize MonitoringTotalAllocatedMemorySize

获取自从创建应用程序域后由应用程序域进行的所有内存分配的总大小(以字节为单位,不扣除已回收的内存)。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.

MonitoringTotalProcessorTime MonitoringTotalProcessorTime MonitoringTotalProcessorTime MonitoringTotalProcessorTime

获取自从进程启动后所有线程在当前应用程序域中执行时所使用的总处理器时间。Gets the total processor time that has been used by all threads while executing in the current application domain, since the process started.

PermissionSet PermissionSet PermissionSet PermissionSet

获取沙盒应用程序域的权限集。Gets the permission set of a sandboxed application domain.

RelativeSearchPath RelativeSearchPath RelativeSearchPath RelativeSearchPath

获取基目录下的路径,在此程序集冲突解决程序应探测专用程序集。Gets the path under the base directory where the assembly resolver should probe for private assemblies.

SetupInformation SetupInformation SetupInformation SetupInformation

获取此实例的应用程序域配置信息。Gets the application domain configuration information for this instance.

ShadowCopyFiles ShadowCopyFiles ShadowCopyFiles ShadowCopyFiles

获取应用程序域是否配置为影像副本文件的指示。Gets an indication whether the application domain is configured to shadow copy files.

方法

AppendPrivatePath(String) AppendPrivatePath(String) AppendPrivatePath(String) AppendPrivatePath(String)

将指定的目录名追加到专用路径列表。Appends the specified directory name to the private path list.

ApplyPolicy(String) ApplyPolicy(String) ApplyPolicy(String) ApplyPolicy(String)

返回应用策略后的程序集显示名称。Returns the assembly display name after policy has been applied.

ClearPrivatePath() ClearPrivatePath() ClearPrivatePath() ClearPrivatePath()

将指定专用程序集位置的路径重置为空字符串 ("")。Resets the path that specifies the location of private assemblies to the empty string ("").

ClearShadowCopyPath() ClearShadowCopyPath() ClearShadowCopyPath() ClearShadowCopyPath()

将包含影像复制的程序集的目录列表重置为空字符串 ("")。Resets the list of directories containing shadow copied assemblies to the empty string ("").

CreateComInstanceFrom(String, String) CreateComInstanceFrom(String, String) CreateComInstanceFrom(String, String) CreateComInstanceFrom(String, String)

创建指定 COM 类型的新实例。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.

CreateComInstanceFrom(String, String, Byte[], AssemblyHashAlgorithm) CreateComInstanceFrom(String, String, Byte[], AssemblyHashAlgorithm) CreateComInstanceFrom(String, String, Byte[], AssemblyHashAlgorithm) CreateComInstanceFrom(String, String, Byte[], AssemblyHashAlgorithm)

创建指定 COM 类型的新实例。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.

CreateDomain(String) CreateDomain(String) CreateDomain(String) CreateDomain(String)

使用指定的名称新建应用程序域。Creates a new application domain with the specified name.

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

使用所提供的证据创建具有给定名称的新应用程序域。Creates a new application domain with the given name using the supplied evidence.

CreateDomain(String, Evidence, AppDomainSetup) CreateDomain(String, Evidence, AppDomainSetup) CreateDomain(String, Evidence, AppDomainSetup) CreateDomain(String, Evidence, AppDomainSetup)

使用指定的名称、证据和应用程序域设置信息创建新的应用程序域。Creates a new application domain using the specified name, evidence, and application domain setup information.

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

使用指定的名称、证据、应用程序域设置信息、默认权限集和一组完全受信任的程序集创建新的应用程序域。Creates a new application domain using the specified name, evidence, application domain setup information, default permission set, and array of fully trusted assemblies.

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

使用证据、应用程序基路径、相对搜索路径和指定是否向应用程序域中加载程序集的影像副本的形参创建具有给定名称的新应用程序域。Creates a new application domain with the given name, using evidence, application base path, relative search path, and a parameter that specifies whether a shadow copy of an assembly is to be loaded into the application domain.

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

使用证据、应用程序基路径、相对搜索路径和指定是否向应用程序域中加载程序集的影像副本的形参创建具有给定名称的新应用程序域。Creates a new application domain with the given name, using evidence, application base path, relative search path, and a parameter that specifies whether a shadow copy of an assembly is to be loaded into the application domain. 指定在初始化应用程序域时调用的回调方法,以及传递回调方法的字符串实参数组。Specifies a callback method that is invoked when the application domain is initialized, and an array of string arguments to pass the callback method.

CreateInstance(String, String) CreateInstance(String, String) CreateInstance(String, String) CreateInstance(String, String)

创建在指定程序集中定义的指定类型的新实例。Creates a new instance of the specified type defined in the specified assembly.

CreateInstance(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[]) CreateInstance(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[]) CreateInstance(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[]) CreateInstance(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[])

创建在指定程序集中定义的指定类型的新实例。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.

CreateInstance(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence) CreateInstance(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence) CreateInstance(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence) CreateInstance(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence)

创建在指定程序集中定义的指定类型的新实例。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.

CreateInstance(String, String, Object[]) CreateInstance(String, String, Object[]) CreateInstance(String, String, Object[]) CreateInstance(String, String, Object[])

创建在指定程序集中定义的指定类型的新实例。Creates a new instance of the specified type defined in the specified assembly. 形参指定激活特性数组。A parameter specifies an array of activation attributes.

CreateInstanceAndUnwrap(String, String) CreateInstanceAndUnwrap(String, String) CreateInstanceAndUnwrap(String, String) CreateInstanceAndUnwrap(String, String)

创建指定类型的新实例。Creates a new instance of the specified type. 形参指定定义类型的程序集以及类型的名称。Parameters specify the assembly where the type is defined, and the name of the type.

CreateInstanceAndUnwrap(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[]) CreateInstanceAndUnwrap(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[]) CreateInstanceAndUnwrap(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[]) CreateInstanceAndUnwrap(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[])

创建在指定的程序集中定义的指定类型的新实例,指定是否忽略类型名称的大小写,并指定绑定特性和用于选择要创建的类型的联编程序、构造函数的自变量、区域性以及激活特性。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.

CreateInstanceAndUnwrap(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence) CreateInstanceAndUnwrap(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence) CreateInstanceAndUnwrap(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence) CreateInstanceAndUnwrap(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence)

创建指定类型的新实例。Creates a new instance of the specified type. 形参指定类型的名称以及查找和创建该类型的方式。Parameters specify the name of the type, and how it is found and created.

CreateInstanceAndUnwrap(String, String, Object[]) CreateInstanceAndUnwrap(String, String, Object[]) CreateInstanceAndUnwrap(String, String, Object[]) CreateInstanceAndUnwrap(String, String, Object[])

创建指定类型的新实例。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.

CreateInstanceFrom(String, String) CreateInstanceFrom(String, String) CreateInstanceFrom(String, String) CreateInstanceFrom(String, String)

创建在指定程序集文件中定义的指定类型的新实例。Creates a new instance of the specified type defined in the specified assembly file.

CreateInstanceFrom(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[]) CreateInstanceFrom(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[]) CreateInstanceFrom(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[]) CreateInstanceFrom(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[])

创建在指定程序集文件中定义的指定类型的新实例。Creates a new instance of the specified type defined in the specified assembly file.

CreateInstanceFrom(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence) CreateInstanceFrom(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence) CreateInstanceFrom(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence) CreateInstanceFrom(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence)

创建在指定程序集文件中定义的指定类型的新实例。Creates a new instance of the specified type defined in the specified assembly file.

CreateInstanceFrom(String, String, Object[]) CreateInstanceFrom(String, String, Object[]) CreateInstanceFrom(String, String, Object[]) CreateInstanceFrom(String, String, Object[])

创建在指定程序集文件中定义的指定类型的新实例。Creates a new instance of the specified type defined in the specified assembly file.

CreateInstanceFromAndUnwrap(String, String) CreateInstanceFromAndUnwrap(String, String) CreateInstanceFromAndUnwrap(String, String) CreateInstanceFromAndUnwrap(String, String)

创建在指定程序集文件中定义的指定类型的新实例。Creates a new instance of the specified type defined in the specified assembly file.

CreateInstanceFromAndUnwrap(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[]) CreateInstanceFromAndUnwrap(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[]) CreateInstanceFromAndUnwrap(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[]) CreateInstanceFromAndUnwrap(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[])

创建在指定的程序集文件中定义的指定类型的新实例,指定是否忽略类型名称的大小写,并指定绑定特性和用于选择要创建的类型的联编程序、构造函数的自变量、区域性以及激活特性。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.

CreateInstanceFromAndUnwrap(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence) CreateInstanceFromAndUnwrap(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence) CreateInstanceFromAndUnwrap(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence) CreateInstanceFromAndUnwrap(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence)

创建在指定程序集文件中定义的指定类型的新实例。Creates a new instance of the specified type defined in the specified assembly file.

CreateInstanceFromAndUnwrap(String, String, Object[]) CreateInstanceFromAndUnwrap(String, String, Object[]) CreateInstanceFromAndUnwrap(String, String, Object[]) CreateInstanceFromAndUnwrap(String, String, Object[])

创建在指定程序集文件中定义的指定类型的新实例。Creates a new instance of the specified type defined in the specified assembly file.

CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type)

创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess)

以指定名称和访问模式定义动态程序集。Defines a dynamic assembly with the specified name and access mode.

DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, Evidence) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, Evidence) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, Evidence) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, Evidence)

使用指定名称、访问模式和证据定义动态程序集。Defines a dynamic assembly using the specified name, access mode, and evidence.

DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, Evidence, PermissionSet, PermissionSet, PermissionSet) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, Evidence, PermissionSet, PermissionSet, PermissionSet) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, Evidence, PermissionSet, PermissionSet, PermissionSet) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, Evidence, PermissionSet, PermissionSet, PermissionSet)

使用指定名称、访问模式、证据和权限请求定义动态程序集。Defines a dynamic assembly using the specified name, access mode, evidence, and permission requests.

DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, IEnumerable<CustomAttributeBuilder>) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, IEnumerable<CustomAttributeBuilder>) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, IEnumerable<CustomAttributeBuilder>) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, IEnumerable<CustomAttributeBuilder>)

使用指定的名称、访问模式和自定义特性定义动态程序集。Defines a dynamic assembly with the specified name, access mode, and custom attributes.

DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, IEnumerable<CustomAttributeBuilder>, SecurityContextSource) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, IEnumerable<CustomAttributeBuilder>, SecurityContextSource) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, IEnumerable<CustomAttributeBuilder>, SecurityContextSource) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, IEnumerable<CustomAttributeBuilder>, SecurityContextSource)

定义具有指定名称、访问模式和自定义特性的动态程序集,并将指定源用于动态程序集的安全上下文。Defines a dynamic assembly with the specified name, access mode, and custom attributes, and using the specified source for its security context.

DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, PermissionSet, PermissionSet, PermissionSet) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, PermissionSet, PermissionSet, PermissionSet) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, PermissionSet, PermissionSet, PermissionSet) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, PermissionSet, PermissionSet, PermissionSet)

使用指定名称、访问模式和权限请求定义动态程序集。Defines a dynamic assembly using the specified name, access mode, and permission requests.

DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String)

使用指定名称、访问模式和存储目录定义动态程序集。Defines a dynamic assembly using the specified name, access mode, and storage directory.

DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, Boolean, IEnumerable<CustomAttributeBuilder>) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, Boolean, IEnumerable<CustomAttributeBuilder>) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, Boolean, IEnumerable<CustomAttributeBuilder>) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, Boolean, IEnumerable<CustomAttributeBuilder>)

使用指定名称、访问模式、存储目录和同步选项定义动态程序集。Defines a dynamic assembly using the specified name, access mode, storage directory, and synchronization option.

DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, Evidence) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, Evidence) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, Evidence) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, Evidence)

使用指定名称、访问模式、存储目录和证据定义动态程序集。Defines a dynamic assembly using the specified name, access mode, storage directory, and evidence.

DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, Evidence, PermissionSet, PermissionSet, PermissionSet) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, Evidence, PermissionSet, PermissionSet, PermissionSet) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, Evidence, PermissionSet, PermissionSet, PermissionSet) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, Evidence, PermissionSet, PermissionSet, PermissionSet)

使用指定名称、访问模式、存储目录、证据和权限请求定义动态程序集。Defines a dynamic assembly using the specified name, access mode, storage directory, evidence, and permission requests.

DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, Evidence, PermissionSet, PermissionSet, PermissionSet, Boolean) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, Evidence, PermissionSet, PermissionSet, PermissionSet, Boolean) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, Evidence, PermissionSet, PermissionSet, PermissionSet, Boolean) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, Evidence, PermissionSet, PermissionSet, PermissionSet, Boolean)

使用指定名称、访问模式、存储目录、证据、权限请求和同步选项定义动态程序集。Defines a dynamic assembly using the specified name, access mode, storage directory, evidence, permission requests, and synchronization option.

DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, Evidence, PermissionSet, PermissionSet, PermissionSet, Boolean, IEnumerable<CustomAttributeBuilder>) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, Evidence, PermissionSet, PermissionSet, PermissionSet, Boolean, IEnumerable<CustomAttributeBuilder>) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, Evidence, PermissionSet, PermissionSet, PermissionSet, Boolean, IEnumerable<CustomAttributeBuilder>) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, Evidence, PermissionSet, PermissionSet, PermissionSet, Boolean, IEnumerable<CustomAttributeBuilder>)

使用指定的名称、访问模式、存储目录、证据、权限请求、同步选项和自定义特性定义动态程序集。Defines a dynamic assembly with the specified name, access mode, storage directory, evidence, permission requests, synchronization option, and custom attributes.

DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, PermissionSet, PermissionSet, PermissionSet) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, PermissionSet, PermissionSet, PermissionSet) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, PermissionSet, PermissionSet, PermissionSet) DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess, String, PermissionSet, PermissionSet, PermissionSet)

使用指定名称、访问模式、存储目录和权限请求定义动态程序集。Defines a dynamic assembly using the specified name, access mode, storage directory, and permission requests.

DoCallBack(CrossAppDomainDelegate) DoCallBack(CrossAppDomainDelegate) DoCallBack(CrossAppDomainDelegate) DoCallBack(CrossAppDomainDelegate)

在另一个应用程序域中执行代码,该应用程序域由指定的委托标识。Executes the code in another application domain that is identified by the specified delegate.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
ExecuteAssembly(String) ExecuteAssembly(String) ExecuteAssembly(String) ExecuteAssembly(String)

执行指定文件中包含的程序集。Executes the assembly contained in the specified file.

ExecuteAssembly(String, Evidence) ExecuteAssembly(String, Evidence) ExecuteAssembly(String, Evidence) ExecuteAssembly(String, Evidence)

使用指定的证据执行指定文件中包含的程序集。Executes the assembly contained in the specified file, using the specified evidence.

ExecuteAssembly(String, Evidence, String[]) ExecuteAssembly(String, Evidence, String[]) ExecuteAssembly(String, Evidence, String[]) ExecuteAssembly(String, Evidence, String[])

使用指定的证据和自变量执行指定文件中包含的程序集。Executes the assembly contained in the specified file, using the specified evidence and arguments.

ExecuteAssembly(String, Evidence, String[], Byte[], AssemblyHashAlgorithm) ExecuteAssembly(String, Evidence, String[], Byte[], AssemblyHashAlgorithm) ExecuteAssembly(String, Evidence, String[], Byte[], AssemblyHashAlgorithm) ExecuteAssembly(String, Evidence, String[], Byte[], AssemblyHashAlgorithm)

使用指定的证据、参数、哈希值和哈希算法执行指定文件中包含的程序集。Executes the assembly contained in the specified file, using the specified evidence, arguments, hash value, and hash algorithm.

ExecuteAssembly(String, String[]) ExecuteAssembly(String, String[]) ExecuteAssembly(String, String[]) ExecuteAssembly(String, String[])

使用指定的参数执行指定文件中包含的程序集。Executes the assembly contained in the specified file, using the specified arguments.

ExecuteAssembly(String, String[], Byte[], AssemblyHashAlgorithm) ExecuteAssembly(String, String[], Byte[], AssemblyHashAlgorithm) ExecuteAssembly(String, String[], Byte[], AssemblyHashAlgorithm) ExecuteAssembly(String, String[], Byte[], AssemblyHashAlgorithm)

使用指定的参数、哈希值和哈希算法执行指定文件中包含的程序集。Executes the assembly contained in the specified file, using the specified arguments, hash value, and hash algorithm.

ExecuteAssemblyByName(AssemblyName, Evidence, String[]) ExecuteAssemblyByName(AssemblyName, Evidence, String[]) ExecuteAssemblyByName(AssemblyName, Evidence, String[]) ExecuteAssemblyByName(AssemblyName, Evidence, String[])

根据给定的 AssemblyName 使用指定的证据和实参执行程序集。Executes the assembly given an AssemblyName, using the specified evidence and arguments.

ExecuteAssemblyByName(AssemblyName, String[]) ExecuteAssemblyByName(AssemblyName, String[]) ExecuteAssemblyByName(AssemblyName, String[]) ExecuteAssemblyByName(AssemblyName, String[])

根据给定的 AssemblyName 使用指定的自变量执行程序集。Executes the assembly given an AssemblyName, using the specified arguments.

ExecuteAssemblyByName(String) ExecuteAssemblyByName(String) ExecuteAssemblyByName(String) ExecuteAssemblyByName(String)

在给定其显示名称的情况下执行程序集。Executes an assembly given its display name.

ExecuteAssemblyByName(String, Evidence) ExecuteAssemblyByName(String, Evidence) ExecuteAssemblyByName(String, Evidence) ExecuteAssemblyByName(String, Evidence)

在给定显示名称的情况下,使用指定证据执行程序集。Executes an assembly given its display name, using the specified evidence.

ExecuteAssemblyByName(String, Evidence, String[]) ExecuteAssemblyByName(String, Evidence, String[]) ExecuteAssemblyByName(String, Evidence, String[]) ExecuteAssemblyByName(String, Evidence, String[])

在给定其显示名称的情况下,使用指定证据和实参执行程序集。Executes the assembly given its display name, using the specified evidence and arguments.

ExecuteAssemblyByName(String, String[]) ExecuteAssemblyByName(String, String[]) ExecuteAssemblyByName(String, String[]) ExecuteAssemblyByName(String, String[])

在给定显示名称的情况下,使用指定自变量执行程序集。Executes the assembly given its display name, using the specified arguments.

GetAssemblies() GetAssemblies() GetAssemblies() GetAssemblies()

获取已加载到此应用程序域的执行上下文中的程序集。Gets the assemblies that have been loaded into the execution context of this application domain.

GetCurrentThreadId() GetCurrentThreadId() GetCurrentThreadId() GetCurrentThreadId()

获取当前线程标识符。Gets the current thread identifier.

GetData(String) GetData(String) GetData(String) GetData(String)

为指定名称获取存储在当前应用程序域中的值。Gets the value stored in the current application domain for the specified name.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

检索控制此实例的生存期策略的当前生存期服务对象。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetType() GetType() GetType() GetType()

获取当前实例的类型。Gets the type of the current instance.

InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

通过防止创建租约来给予 AppDomain 无限生存期。Gives the AppDomain an infinite lifetime by preventing a lease from being created.

IsCompatibilitySwitchSet(String) IsCompatibilitySwitchSet(String) IsCompatibilitySwitchSet(String) IsCompatibilitySwitchSet(String)

获取可以为 null 的布尔值,该值指示是否设置了任何兼容性开关,如果已设置,则指定是否设置了指定的兼容性开关。Gets a nullable Boolean value that indicates whether any compatibility switches are set, and if so, whether the specified compatibility switch is set.

IsDefaultAppDomain() IsDefaultAppDomain() IsDefaultAppDomain() IsDefaultAppDomain()

返回一个值,指示应用程序域是否是进程的默认应用程序域。Returns a value that indicates whether the application domain is the default application domain for the process.

IsFinalizingForUnload() IsFinalizingForUnload() IsFinalizingForUnload() IsFinalizingForUnload()

指示此应用程序域是否正在卸载以及公共语言运行时是否正在终止该域包含的对象。Indicates whether this application domain is unloading, and the objects it contains are being finalized by the common language runtime.

Load(AssemblyName) Load(AssemblyName) Load(AssemblyName) Load(AssemblyName)

在给定 AssemblyName 的情况下加载 AssemblyLoads an Assembly given its AssemblyName.

Load(AssemblyName, Evidence) Load(AssemblyName, Evidence) Load(AssemblyName, Evidence) Load(AssemblyName, Evidence)

在给定 AssemblyName 的情况下加载 AssemblyLoads an Assembly given its AssemblyName.

Load(Byte[]) Load(Byte[]) Load(Byte[]) Load(Byte[])

加载带有基于通用对象文件格式 (COFF) 的图像的 Assembly,该图像包含已发出的 AssemblyLoads the Assembly with a common object file format (COFF) based image containing an emitted Assembly.

Load(Byte[], Byte[]) Load(Byte[], Byte[]) Load(Byte[], Byte[]) Load(Byte[], Byte[])

加载带有基于通用对象文件格式 (COFF) 的图像的 Assembly,该图像包含已发出的 AssemblyLoads the Assembly with a common object file format (COFF) based image containing an emitted Assembly. 还加载表示 Assembly 的符号的原始字节。The raw bytes representing the symbols for the Assembly are also loaded.

Load(Byte[], Byte[], Evidence) Load(Byte[], Byte[], Evidence) Load(Byte[], Byte[], Evidence) Load(Byte[], Byte[], Evidence)

加载带有基于通用对象文件格式 (COFF) 的图像的 Assembly,该图像包含已发出的 AssemblyLoads the Assembly with a common object file format (COFF) based image containing an emitted Assembly. 还加载表示 Assembly 的符号的原始字节。The raw bytes representing the symbols for the Assembly are also loaded.

Load(String) Load(String) Load(String) Load(String)

在给定其显示名称的情况下加载 AssemblyLoads an Assembly given its display name.

Load(String, Evidence) Load(String, Evidence) Load(String, Evidence) Load(String, Evidence)

在给定其显示名称的情况下加载 AssemblyLoads an Assembly given its display name.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

创建当前 MarshalByRefObject 对象的浅表副本。Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
ReflectionOnlyGetAssemblies() ReflectionOnlyGetAssemblies() ReflectionOnlyGetAssemblies() ReflectionOnlyGetAssemblies()

返回已加载到应用程序域的只反射上下文中的程序集。Returns the assemblies that have been loaded into the reflection-only context of the application domain.

SetAppDomainPolicy(PolicyLevel) SetAppDomainPolicy(PolicyLevel) SetAppDomainPolicy(PolicyLevel) SetAppDomainPolicy(PolicyLevel)

为此应用程序域确定安全策略级别。Establishes the security policy level for this application domain.

SetCachePath(String) SetCachePath(String) SetCachePath(String) SetCachePath(String)

确定指定目录路径为对程序集进行影像复制的位置。Establishes the specified directory path as the location where assemblies are shadow copied.

SetData(String, Object) SetData(String, Object) SetData(String, Object) SetData(String, Object)

为指定的应用程序域属性分配指定值。Assigns the specified value to the specified application domain property.

SetData(String, Object, IPermission) SetData(String, Object, IPermission) SetData(String, Object, IPermission) SetData(String, Object, IPermission)

将指定值分配给指定应用程序域属性,检索该属性时要求调用方具有指定权限。Assigns the specified value to the specified application domain property, with a specified permission to demand of the caller when the property is retrieved.

SetDynamicBase(String) SetDynamicBase(String) SetDynamicBase(String) SetDynamicBase(String)

建立指定的目录路径,作为存储和访问动态生成的文件的子目录的基目录。Establishes the specified directory path as the base directory for subdirectories where dynamically generated files are stored and accessed.

SetPrincipalPolicy(PrincipalPolicy) SetPrincipalPolicy(PrincipalPolicy) SetPrincipalPolicy(PrincipalPolicy) SetPrincipalPolicy(PrincipalPolicy)

指定在此应用程序域中执行时如果线程尝试绑定到用户,用户和标识对象应如何附加到该线程。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.

SetShadowCopyFiles() SetShadowCopyFiles() SetShadowCopyFiles() SetShadowCopyFiles()

打开影像复制功能。Turns on shadow copying.

SetShadowCopyPath(String) SetShadowCopyPath(String) SetShadowCopyPath(String) SetShadowCopyPath(String)

确定指定目录路径为要进行影像复制的程序集的位置。Establishes the specified directory path as the location of assemblies to be shadow copied.

SetThreadPrincipal(IPrincipal) SetThreadPrincipal(IPrincipal) SetThreadPrincipal(IPrincipal) SetThreadPrincipal(IPrincipal)

设置在以下情况下要附加到线程的默认主体对象,即当线程在此应用程序域中执行时,如果线程尝试绑定到主体这种情况。Sets the default principal object to be attached to threads if they attempt to bind to a principal while executing in this application domain.

ToString() ToString() ToString() ToString()

获取一个字符串表示,包含应用程序域友好名称和任意上下文策略。Obtains a string representation that includes the friendly name of the application domain and any context policies.

Unload(AppDomain) Unload(AppDomain) Unload(AppDomain) Unload(AppDomain)

卸载指定的应用程序域。Unloads the specified application domain.

事件

AssemblyLoad AssemblyLoad AssemblyLoad AssemblyLoad

在加载程序集时发生。Occurs when an assembly is loaded.

AssemblyResolve AssemblyResolve AssemblyResolve AssemblyResolve

在对程序集的解析失败时发生。Occurs when the resolution of an assembly fails.

DomainUnload DomainUnload DomainUnload DomainUnload

在即将卸载 AppDomain 时发生。Occurs when an AppDomain is about to be unloaded.

FirstChanceException FirstChanceException FirstChanceException FirstChanceException

当托管代码抛出异常时发生,在运行时在调用堆栈中搜索应用程序域中的异常处理程序之前。Occurs when an exception is thrown in managed code, before the runtime searches the call stack for an exception handler in the application domain.

ProcessExit ProcessExit ProcessExit ProcessExit

当默认应用程序域的父进程退出时发生。Occurs when the default application domain's parent process exits.

ReflectionOnlyAssemblyResolve ReflectionOnlyAssemblyResolve ReflectionOnlyAssemblyResolve ReflectionOnlyAssemblyResolve

当程序集的解析在仅限反射的上下文中失败时发生。Occurs when the resolution of an assembly fails in the reflection-only context.

ResourceResolve ResourceResolve ResourceResolve ResourceResolve

当资源解析因资源不是程序集中的有效链接资源或嵌入资源而失败时发生。Occurs when the resolution of a resource fails because the resource is not a valid linked or embedded resource in the assembly.

TypeResolve TypeResolve TypeResolve TypeResolve

在对类型的解析失败时发生。Occurs when the resolution of a type fails.

UnhandledException UnhandledException UnhandledException UnhandledException

当某个异常未被捕获时出现。Occurs when an exception is not caught.

显式界面实现

_AppDomain.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _AppDomain.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _AppDomain.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _AppDomain.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

将一组名称映射为对应的一组调度标识符。Maps a set of names to a corresponding set of dispatch identifiers.

_AppDomain.GetTypeInfo(UInt32, UInt32, IntPtr) _AppDomain.GetTypeInfo(UInt32, UInt32, IntPtr) _AppDomain.GetTypeInfo(UInt32, UInt32, IntPtr) _AppDomain.GetTypeInfo(UInt32, UInt32, IntPtr)

检索对象的类型信息,然后可以使用该信息获取接口的类型信息。Retrieves the type information for an object, which can then be used to get the type information for an interface.

_AppDomain.GetTypeInfoCount(UInt32) _AppDomain.GetTypeInfoCount(UInt32) _AppDomain.GetTypeInfoCount(UInt32) _AppDomain.GetTypeInfoCount(UInt32)

检索对象提供的类型信息接口的数量(0 或 1)。Retrieves the number of type information interfaces that an object provides (either 0 or 1).

_AppDomain.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _AppDomain.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _AppDomain.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _AppDomain.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

提供对某一对象公开的属性和方法的访问。Provides access to properties and methods exposed by an object.

适用于

另请参阅