Assembly Class

定義

表示組件 (Assembly),此組件是可重複使用、可控制版本和自我描述的 Common Language Runtime 應用程式建置區塊。 Represents an assembly, which is a reusable, versionable, and self-describing building block of a common language runtime application.

[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComVisible(true)]
public abstract class Assembly : System.Reflection.ICustomAttributeProvider, System.Runtime.InteropServices._Assembly, System.Runtime.Serialization.ISerializable, System.Security.IEvidenceFactory
繼承
Assembly
衍生
屬性
實作

範例

下列程式碼範例示範如何取得目前執行的組件、 建立該組件,內含類型的執行個體和叫用其中一種類型的方法具有晚期繫結。The following code example shows how to obtain the currently executing assembly, create an instance of a type contained in that assembly, and invoke one of the type's methods with late binding. 基於此目的,在程式碼範例定義名為類別Example,與名為方法SampleMethodFor this purpose, the code example defines a class named Example, with a method named SampleMethod. 類別的建構函式會接受一個整數,用來計算該方法的傳回值。The constructor of the class accepts an integer, which is used to compute the return value of the method.

在程式碼範例也示範如何使用GetName方法,以取得AssemblyName可以用來剖析組件的完整名稱的物件。The code example also demonstrates the use of the GetName method to obtain an AssemblyName object that can be used to parse the full name of the assembly. 此範例會顯示組件的版本號碼CodeBase屬性,而EntryPoint屬性。The example displays the version number of the assembly, the CodeBase property, and the EntryPoint property.

using namespace System;
using namespace System::Reflection;
using namespace System::Security::Permissions;

[assembly:AssemblyVersionAttribute("1.0.2000.0")];

public ref class Example
{
private: 
    int factor;

public:
    Example(int f)
    {
        factor = f;
    }

    int SampleMethod(int x) 
    { 
        Console::WriteLine("\nExample->SampleMethod({0}) executes.", x);
        return x * factor;
    }
};

void main()
{
    Assembly^ assem = Example::typeid->Assembly;

    Console::WriteLine("Assembly Full Name:");
    Console::WriteLine(assem->FullName);

    // The AssemblyName type can be used to parse the full name.
    AssemblyName^ assemName = assem->GetName();
    Console::WriteLine("\nName: {0}", assemName->Name);
    Console::WriteLine("Version: {0}.{1}", 
        assemName->Version->Major, assemName->Version->Minor);

    Console::WriteLine("\nAssembly CodeBase:");
    Console::WriteLine(assem->CodeBase);

    // Create an object from the assembly, passing in the correct number and
    // type of arguments for the constructor.
    Object^ o = assem->CreateInstance("Example", false, 
        BindingFlags::ExactBinding, 
        nullptr, gcnew array<Object^> { 2 }, nullptr, nullptr);

    // Make a late-bound call to an instance method of the object.    
    MethodInfo^ m = assem->GetType("Example")->GetMethod("SampleMethod");
    Object^ ret = m->Invoke(o, gcnew array<Object^> { 42 });
    Console::WriteLine("SampleMethod returned {0}.", ret);

    Console::WriteLine("\nAssembly entry point:");
    Console::WriteLine(assem->EntryPoint);
}

/* This code example produces output similar to the following:

Assembly Full Name:
source, Version=1.0.2000.0, Culture=neutral, PublicKeyToken=null

Name: source
Version: 1.0

Assembly CodeBase:
file:///C:/sdtree/AssemblyClass/cpp/source.exe

Example->SampleMethod(42) executes.
SampleMethod returned 84.

Assembly entry point:
UInt32 _mainCRTStartup()
 */
using System;
using System.Reflection;
using System.Security.Permissions;

[assembly:AssemblyVersionAttribute("1.0.2000.0")]

public class Example
{
    private int factor;
    public Example(int f)
    {
        factor = f;
    }

    public int SampleMethod(int x) 
    { 
        Console.WriteLine("\nExample.SampleMethod({0}) executes.", x);
        return x * factor;
    }

    public static void Main()
    {
        Assembly assem = typeof(Example).Assembly;

        Console.WriteLine("Assembly Full Name:");
        Console.WriteLine(assem.FullName);

        // The AssemblyName type can be used to parse the full name.
        AssemblyName assemName = assem.GetName();
        Console.WriteLine("\nName: {0}", assemName.Name);
        Console.WriteLine("Version: {0}.{1}", 
            assemName.Version.Major, assemName.Version.Minor);

        Console.WriteLine("\nAssembly CodeBase:");
        Console.WriteLine(assem.CodeBase);

        // Create an object from the assembly, passing in the correct number
        // and type of arguments for the constructor.
        Object o = assem.CreateInstance("Example", false, 
            BindingFlags.ExactBinding, 
            null, new Object[] { 2 }, null, null);

        // Make a late-bound call to an instance method of the object.    
        MethodInfo m = assem.GetType("Example").GetMethod("SampleMethod");
        Object ret = m.Invoke(o, new Object[] { 42 });
        Console.WriteLine("SampleMethod returned {0}.", ret);

        Console.WriteLine("\nAssembly entry point:");
        Console.WriteLine(assem.EntryPoint);
    }
}

/* This code example produces output similar to the following:

Assembly Full Name:
source, Version=1.0.2000.0, Culture=neutral, PublicKeyToken=null

Name: source
Version: 1.0

Assembly CodeBase:
file:///C:/sdtree/AssemblyClass/cs/source.exe

Example.SampleMethod(42) executes.
SampleMethod returned 84.

Assembly entry point:
Void Main()
 */
Imports System
Imports System.Reflection
Imports System.Security.Permissions

<assembly: AssemblyVersionAttribute("1.0.2000.0")>

Public Class Example
    Private factor As Integer
    
    Public Sub New(ByVal f As Integer) 
        factor = f
    End Sub 
    
    Public Function SampleMethod(ByVal x As Integer) As Integer 
        Console.WriteLine(vbCrLf & "Example.SampleMethod({0}) executes.", x)
        Return x * factor
    End Function 
    
    Public Shared Sub Main() 
        Dim assem As Assembly = GetType(Example).Assembly
        
        Console.WriteLine("Assembly Full Name:")
        Console.WriteLine(assem.FullName)
        
        ' The AssemblyName type can be used to parse the full name.
        Dim assemName As AssemblyName = assem.GetName()
        Console.WriteLine(vbLf + "Name: {0}", assemName.Name)
        Console.WriteLine("Version: {0}.{1}", assemName.Version.Major, _
            assemName.Version.Minor)
        
        Console.WriteLine(vbLf + "Assembly CodeBase:")
        Console.WriteLine(assem.CodeBase)
        
        ' Create an object from the assembly, passing in the correct number
        ' and type of arguments for the constructor.
        Dim o As Object = assem.CreateInstance("Example", False, _
            BindingFlags.ExactBinding, Nothing, _
            New Object() { 2 }, Nothing, Nothing)
        
        ' Make a late-bound call to an instance method of the object.    
        Dim m As MethodInfo = assem.GetType("Example").GetMethod("SampleMethod")
        Dim ret As Object = m.Invoke(o, New Object() { 42 })
        Console.WriteLine("SampleMethod returned {0}.", ret)
        
        Console.WriteLine(vbCrLf & "Assembly entry point:")
        Console.WriteLine(assem.EntryPoint)
    
    End Sub 
End Class 

' This code example produces output similar to the following:
'
'Assembly Full Name:
'source, Version=1.0.2000.0, Culture=neutral, PublicKeyToken=null
'
'Name: source
'Version: 1.0
'
'Assembly CodeBase:
'file:///C:/sdtree/AssemblyClass/vb/source.exe
'
'Example.SampleMethod(42) executes.
'SampleMethod returned 84.
'
'Assembly entry point:
'Void Main()
' 

備註

使用Assembly類別來載入組件,來瀏覽組件,來探索組件中包含的型別,以及建立這些類型的執行個體的中繼資料和組成組件。Use the Assembly class to load assemblies, to explore the metadata and constituent parts of assemblies, to discover the types contained in assemblies, and to create instances of those types.

若要取得的陣列Assembly物件代表目前的組件載入應用程式定義域 (比方說的預設應用程式定義域的簡單專案),使用AppDomain.GetAssemblies方法。To get an array of Assembly objects representing the assemblies currently loaded into an application domain (for example, the default application domain of a simple project), use the AppDomain.GetAssemblies method.

以動態方式載入組件Assembly類別提供下列靜態方法 (Shared方法在 Visual Basic 中的)。To load assemblies dynamically, the Assembly class provides the following static methods (Shared methods in Visual Basic). 組件會載入應用程式定義域載入作業發生的位置。Assemblies are loaded into the application domain where the load operation occurs.

  • 載入組件的建議的方式是使用Load方法,用來識別要由其顯示名稱所載入的組件 (比方說,"System.Windows.Forms,version=2.0.0.0,Culture = neutral,publickeytoken=b77a5c561934e089")。The recommended way to load assemblies is to use the Load method, which identifies the assembly to be loaded by its display name (for example, "System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"). 組件的搜尋會遵循規則中所述執行階段如何找出組件The search for the assembly follows the rules described in How the Runtime Locates Assemblies.

  • ReflectionOnlyLoadReflectionOnlyLoadFrom方法可讓您載入組件反映,但不是執行。The ReflectionOnlyLoad and ReflectionOnlyLoadFrom methods enable you to load an assembly for reflection, but not for execution. 比方說,64 位元平台為目標的組件由 32 位元平台執行的程式碼進行檢查。For example, an assembly that targets a 64-bit platform can be examined by code that is running on a 32-bit platform.

  • LoadFileLoadFrom方法提供極少數的情況下必須路徑所識別的組件中。The LoadFile and LoadFrom methods are provided for rare scenarios in which an assembly must be identified by path.

若要取得Assembly物件的目前執行的組件,用來使用GetExecutingAssembly方法。To get an Assembly object for the currently executing assembly, use the GetExecutingAssembly method.

許多成員的Assembly類別提供組件的相關資訊。Many members of the Assembly class provide information about an assembly. 例如: For example:

GetTypes方法列出組件中的所有型別。The GetTypes method lists all the types in the assembly. GetExportedTypes方法列出呼叫端組件外部可見的類型。The GetExportedTypes method lists the types that are visible to callers outside the assembly. GetType方法可以用來搜尋特定型別的組件中。The GetType method can be used to search for a particular type in the assembly. CreateInstance方法可以用來搜尋及組件中建立型別的執行個體。The CreateInstance method can be used to search for and create instances of types in the assembly.

如需有關組件的詳細資訊,請參閱 < 應用程式定義域和組件 > 一節應用程式定義域主題。For more information on assemblies, see the "Application Domains and Assemblies" section in the Application Domains topic.

建構函式

Assembly()

初始化 Assembly 類別的新執行個體。 Initializes a new instance of the Assembly class.

屬性

CodeBase

取得組件位置,例如原先在 AssemblyName 物件中指定的。 Gets the location of the assembly as specified originally, for example, in an AssemblyName object.

CustomAttributes

取得包含此組件之自訂屬性的集合。 Gets a collection that contains this assembly's custom attributes.

DefinedTypes

取得這個組件中定義之類型的集合。 Gets a collection of the types defined in this assembly.

EntryPoint

取得這個組件的進入點。 Gets the entry point of this assembly.

EscapedCodeBase

取得代表基礎碼的 URI,包括逸出字元。 Gets the URI, including escape characters, that represents the codebase.

Evidence

取得這個組件的辨識碼。 Gets the evidence for this assembly.

ExportedTypes

取得在這個組件中定義的公用類型集合,而這些類型在組件外部是可見的。 Gets a collection of the public types defined in this assembly that are visible outside the assembly.

FullName

取得組件的顯示名稱。 Gets the display name of the assembly.

GlobalAssemblyCache

取得值,指出組件是否從全域組件快取載入。 Gets a value indicating whether the assembly was loaded from the global assembly cache.

HostContext

取得用來載入組件的主應用程式內容。 Gets the host context with which the assembly was loaded.

ImageRuntimeVersion

取得字串,表示儲存在含有資訊清單之檔案中的 Common Language Runtime (CLR) 版本。 Gets a string representing the version of the common language runtime (CLR) saved in the file containing the manifest.

IsDynamic

取得值,這個值表示目前組件是否使用反映發出在目前處理序中動態產生。 Gets a value that indicates whether the current assembly was generated dynamically in the current process by using reflection emit.

IsFullyTrusted

取得值,這個值表示目前組件是否以完全信任來載入。 Gets a value that indicates whether the current assembly is loaded with full trust.

Location

取得包含資訊清單之載入檔的完整路徑或 UNC 位置。 Gets the full path or UNC location of the loaded file that contains the manifest.

ManifestModule

取得包含目前組件之資訊清單的模組。 Gets the module that contains the manifest for the current assembly.

Modules

取得包含這個組件中模組的集合。 Gets a collection that contains the modules in this assembly.

PermissionSet

取得目前組件的授權集。 Gets the grant set of the current assembly.

ReflectionOnly

取得 Boolean 值,指出這個組件是否已載入僅限反映的內容中。 Gets a Boolean value indicating whether this assembly was loaded into the reflection-only context.

SecurityRuleSet

取得值,這個值指出應針對此組件強制執行的 Common Language Runtime (CLR) 安全性規則組合。 Gets a value that indicates which set of security rules the common language runtime (CLR) enforces for this assembly.

方法

CreateInstance(String)

從這個組件找出指定類型,並使用系統啟動項,利用區分大小寫的搜尋,建立它的執行個體。 Locates the specified type from this assembly and creates an instance of it using the system activator, using case-sensitive search.

CreateInstance(String, Boolean)

從這個組件找出指定類型,並使用系統啟動項,利用選擇性區分大小寫的搜尋,建立它的執行個體。 Locates the specified type from this assembly and creates an instance of it using the system activator, with optional case-sensitive search.

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

從這個組件找出指定類型,並使用系統啟動項,利用選擇性區分大小寫的搜尋,以及取得指定文化特性 (Culture)、引數和繫結和啟動屬性,建立它的執行個體。 Locates the specified type from this assembly and creates an instance of it using the system activator, with optional case-sensitive search and having the specified culture, arguments, and binding and activation attributes.

CreateQualifiedName(String, String)

建立類型名稱,由其組件的顯示名稱所限定。 Creates the name of a type qualified by the display name of its assembly.

Equals(Object)

判斷這個組件和指定的物件是否相等。 Determines whether this assembly and the specified object are equal.

GetAssembly(Type)

取得目前載入的組件,其中定義指定類型。 Gets the currently loaded assembly in which the specified type is defined.

GetCallingAssembly()

傳回方法的 Assembly,其叫用目前執行的方法。 Returns the Assembly of the method that invoked the currently executing method.

GetCustomAttributes(Boolean)

取得這個組件的所有自訂屬性。 Gets all the custom attributes for this assembly.

GetCustomAttributes(Type, Boolean)

取得這個組件由類型所指定的自訂屬性。 Gets the custom attributes for this assembly as specified by type.

GetCustomAttributesData()

傳回已套用至目前 Assembly 之屬性的相關資訊,表示為 CustomAttributeData 物件。 Returns information about the attributes that have been applied to the current Assembly, expressed as CustomAttributeData objects.

GetEntryAssembly()

取得預設應用程式定義域中的處理序可執行檔。 Gets the process executable in the default application domain. 在其他應用程式定義域中,這是由 ExecuteAssembly(String) 執行的第一個可執行檔。 In other application domains, this is the first executable that was executed by ExecuteAssembly(String).

GetExecutingAssembly()

取得組件,其中含有目前正在執行的程式碼。 Gets the assembly that contains the code that is currently executing.

GetExportedTypes()

取得在這個組件中定義的公用類型,而這些類型在組件外部是可見的。 Gets the public types defined in this assembly that are visible outside the assembly.

GetFile(String)

取得指定之檔案的 FileStream,這個指定之檔案位於這個組件的資訊清單檔案表中。 Gets a FileStream for the specified file in the file table of the manifest of this assembly.

GetFiles()

取得組件資訊清單檔案表中的檔案。 Gets the files in the file table of an assembly manifest.

GetFiles(Boolean)

取得組件資訊清單檔案表中的檔案,指定是否要包含資源模組。 Gets the files in the file table of an assembly manifest, specifying whether to include resource modules.

GetForwardedTypes()
GetHashCode()

傳回這個執行個體的雜湊碼。 Returns the hash code for this instance.

GetLoadedModules()

取得做為這個組件部分的所有載入模組。 Gets all the loaded modules that are part of this assembly.

GetLoadedModules(Boolean)

取得做為這個組件部分的所有載入模組,指定是否要包含資源模組。 Gets all the loaded modules that are part of this assembly, specifying whether to include resource modules.

GetManifestResourceInfo(String)

傳回指定資源已保存方式的資訊。 Returns information about how the given resource has been persisted.

GetManifestResourceNames()

傳回這個組件中的所有資源名稱。 Returns the names of all the resources in this assembly.

GetManifestResourceStream(String)

載入來自這個組件的指定資訊清單資源。 Loads the specified manifest resource from this assembly.

GetManifestResourceStream(Type, String)

從這個組件載入指定資訊清單資源,由指定類型的命名空間限定範圍。 Loads the specified manifest resource, scoped by the namespace of the specified type, from this assembly.

GetModule(String)

取得這個組件中的指定模組。 Gets the specified module in this assembly.

GetModules()

取得所有屬於這個組件的模組。 Gets all the modules that are part of this assembly.

GetModules(Boolean)

取得所有屬於這個組件的模組,指定是否要包含資源模組。 Gets all the modules that are part of this assembly, specifying whether to include resource modules.

GetName()

取得這個組件的 AssemblyName Gets an AssemblyName for this assembly.

GetName(Boolean)

取得這個組件的 AssemblyName,設定按照 copiedName 指定的基礎碼。 Gets an AssemblyName for this assembly, setting the codebase as specified by copiedName.

GetObjectData(SerializationInfo, StreamingContext)

使用要重新執行個體化這個組件所需的所有資料,取得序列化 (Serialization) 資訊。 Gets serialization information with all of the data needed to reinstantiate this assembly.

GetReferencedAssemblies()

取得這個組件參考之所有組件的 AssemblyName 物件。 Gets the AssemblyName objects for all the assemblies referenced by this assembly.

GetSatelliteAssembly(CultureInfo)

取得指定文化特性的附屬組件。 Gets the satellite assembly for the specified culture.

GetSatelliteAssembly(CultureInfo, Version)

取得指定文化特性的附屬組件指定版本。 Gets the specified version of the satellite assembly for the specified culture.

GetType()
GetType(String)

取得具有組件執行個體中指定名稱的 Type 物件。 Gets the Type object with the specified name in the assembly instance.

GetType(String, Boolean)

取得具有組件執行個體中指定之名稱的 Type 物件,並在找不到類型時選擇性地擲回例外狀況。 Gets the Type object with the specified name in the assembly instance and optionally throws an exception if the type is not found.

GetType(String, Boolean, Boolean)

使用忽略大小寫和找不到類型時擲回例外狀況的選項,取得具有組件執行個體中指定之名稱的 Type 物件。 Gets the Type object with the specified name in the assembly instance, with the options of ignoring the case, and of throwing an exception if the type is not found.

GetTypes()

取得定義於這個組件中的類型。 Gets the types defined in this assembly.

IsDefined(Type, Boolean)

指出是否已將指定的屬性套用至組件。 Indicates whether or not a specified attribute has been applied to the assembly.

Load(AssemblyName)

載入組件,指定其 AssemblyName Loads an assembly given its AssemblyName.

Load(AssemblyName, Evidence)

載入組件,指定其 AssemblyName Loads an assembly given its AssemblyName. 使用所提供的辨識項,將組件載入至呼叫端的定義域。 The assembly is loaded into the domain of the caller using the supplied evidence.

Load(Byte[])

載入具有通用物件檔案格式 (Common Object File Format,COFF) 之映像的組件 (包含發出的組件)。 Loads the assembly with a common object file format (COFF)-based image containing an emitted assembly. 組件會載入至呼叫端的應用程式定義域。 The assembly is loaded into the application domain of the caller.

Load(Byte[], Byte[])

使用通用物件檔案格式 (COFF) 映像載入組件,其中包含已發出的組件,並可選擇性地包含組件的符號。 Loads the assembly with a common object file format (COFF)-based image containing an emitted assembly, optionally including symbols for the assembly. 組件會載入至呼叫端的應用程式定義域。 The assembly is loaded into the application domain of the caller.

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

使用通用物件檔案格式 (COFF) 映像載入組件,其中包含已發出的組件,並可選擇性地包含組件的符號和辨識項。 Loads the assembly with a common object file format (COFF)-based image containing an emitted assembly, optionally including symbols and evidence for the assembly. 組件會載入至呼叫端的應用程式定義域。 The assembly is loaded into the application domain of the caller.

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

使用通用物件檔案格式 (COFF) 映像載入組件,其中包含已發出的組件,並可選擇性地包含組件的符號,以及指定安全性內容的來源。 Loads the assembly with a common object file format (COFF)-based image containing an emitted assembly, optionally including symbols and specifying the source for the security context. 組件會載入至呼叫端的應用程式定義域。 The assembly is loaded into the application domain of the caller.

Load(String)

載入組件,其名稱指定為完整格式。 Loads an assembly given the long form of its name.

Load(String, Evidence)

載入提供其顯示名稱的組件,使用提供的辨識項將組件載入至呼叫端的定義域。 Loads an assembly given its display name, loading the assembly into the domain of the caller using the supplied evidence.

LoadFile(String)

載入指定路徑上組件檔案的內容。 Loads the contents of an assembly file on the specified path.

LoadFile(String, Evidence)

載入既定路徑的組件,並使用提供的辨識項將組件載入至呼叫端的定義域。 Loads an assembly given its path, loading the assembly into the domain of the caller using the supplied evidence.

LoadFrom(String)

載入組件,指定其檔案名稱或路徑。 Loads an assembly given its file name or path.

LoadFrom(String, Byte[], AssemblyHashAlgorithm)

指定組件的檔案名稱或路徑,雜湊值和雜湊演算法,來載入組件。 Loads an assembly given its file name or path, hash value, and hash algorithm.

LoadFrom(String, Evidence)

載入組件,指定其檔案名稱或路徑,並提供安全性辨識項。 Loads an assembly given its file name or path and supplying security evidence.

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

指定組件的檔案名稱或路徑、安全性辨識項、雜湊值和雜湊演算法,來載入組件。 Loads an assembly given its file name or path, security evidence, hash value, and hash algorithm.

LoadModule(String, Byte[])

使用通用物件檔案格式 (COFF) 為基礎的映像 (包含發出的模組) 或是資源檔,載入組件的內部模組。 Loads the module, internal to this assembly, with a common object file format (COFF)-based image containing an emitted module, or a resource file.

LoadModule(String, Byte[], Byte[])

使用通用物件檔案格式 (COFF) 為基礎的映像 (包含發出的模組) 或是資源檔,載入組件的內部模組。 Loads the module, internal to this assembly, with a common object file format (COFF)-based image containing an emitted module, or a resource file. 表示模組符號的未經處理位元組也載入。 The raw bytes representing the symbols for the module are also loaded.

LoadWithPartialName(String)

使用部分的名稱,從應用程式目錄或從全域組件快取載入組件。 Loads an assembly from the application directory or from the global assembly cache using a partial name.

LoadWithPartialName(String, Evidence)

使用部分的名稱,從應用程式目錄或從全域組件快取載入組件。 Loads an assembly from the application directory or from the global assembly cache using a partial name. 使用所提供的辨識項,將組件載入至呼叫端的定義域。 The assembly is loaded into the domain of the caller using the supplied evidence.

MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。 Creates a shallow copy of the current Object.

(Inherited from Object)
ReflectionOnlyLoad(Byte[])

從以通用物件檔案格式 (COFF) 為基礎的映像 (包含發出的組件) 載入組件。 Loads the assembly from a common object file format (COFF)-based image containing an emitted assembly. 這個組件會載入呼叫端應用程式定義域之僅限反映的內容中。 The assembly is loaded into the reflection-only context of the caller's application domain.

ReflectionOnlyLoad(String)

將組件載入僅限反映的內容中,並指定其顯示名稱。 Loads an assembly into the reflection-only context, given its display name.

ReflectionOnlyLoadFrom(String)

將組件載入僅限反映的內容中,並指定其路徑。 Loads an assembly into the reflection-only context, given its path.

ToString()

傳回組件的完整名稱,也稱為顯示名稱。 Returns the full name of the assembly, also known as the display name.

UnsafeLoadFrom(String)

將組件載入到載入內容中,並略過部分安全性檢查。 Loads an assembly into the load-from context, bypassing some security checks.

事件

ModuleResolve

發生於 Common Language Runtime 類別載入器無法經由一般方法解析對組件內部模組的參考時。 Occurs when the common language runtime class loader cannot resolve a reference to an internal module of an assembly through normal means.

運算子

Equality(Assembly, Assembly)

表示兩個 Assembly 物件是否相等。 Indicates whether two Assembly objects are equal.

Inequality(Assembly, Assembly)

表示兩個 Assembly 物件是否不相等。 Indicates whether two Assembly objects are not equal.

明確介面實作

ICustomAttributeProvider.GetCustomAttributes(Boolean)
ICustomAttributeProvider.GetCustomAttributes(Type, Boolean)
ICustomAttributeProvider.IsDefined(Type, Boolean)
_Assembly.GetType()

傳回目前執行個體的類型。 Returns the type of the current instance.

安全性

InheritanceDemand
針對繼承者完全信任。 for full trust for inheritors. 這個類別無法繼承由部分信任的程式碼。 This class cannot be inherited by partially trusted code.

適用於

執行緒安全性

此型別具備執行緒安全。 This type is thread safe.

另請參閱