Assembly.Load 方法

定義

載入組件。

多載

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

使用通用物件檔案格式 (COFF) 映像載入組件,其中包含已發出的組件,並可選擇性地包含組件的符號,以及指定安全性內容的來源。

Load(Byte[], Byte[], Evidence)
已淘汰.

使用通用物件檔案格式 (COFF) 映像載入組件,其中包含已發出的組件,並可選擇性地包含組件的符號和辨識項。

Load(String, Evidence)
已淘汰.

載入元件,指定其顯示名稱,並使用提供的辨識項。

Load(AssemblyName, Evidence)
已淘汰.

載入組件,指定其 AssemblyName。 元件會使用提供的辨識項載入。

Load(Byte[])

載入具有通用物件檔案格式 (Common Object File Format,COFF) 之映像的組件 (包含發出的組件)。

Load(String)

載入具有指定名稱的組件。

Load(AssemblyName)

載入組件,指定其 AssemblyName

Load(Byte[], Byte[])

使用通用物件檔案格式 (COFF) 映像載入組件,其中包含已發出的組件,並可選擇性地包含組件的符號。

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

使用通用物件檔案格式 (COFF) 映像載入組件,其中包含已發出的組件,並可選擇性地包含組件的符號,以及指定安全性內容的來源。

public:
 static System::Reflection::Assembly ^ Load(cli::array <System::Byte> ^ rawAssembly, cli::array <System::Byte> ^ rawSymbolStore, System::Security::SecurityContextSource securityContextSource);
public static System.Reflection.Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore, System.Security.SecurityContextSource securityContextSource);
static member Load : byte[] * byte[] * System.Security.SecurityContextSource -> System.Reflection.Assembly
Public Shared Function Load (rawAssembly As Byte(), rawSymbolStore As Byte(), securityContextSource As SecurityContextSource) As Assembly

參數

rawAssembly
Byte[]

位元組陣列,該陣列是以 COFF 為基礎的影像,其中包含發出的組件。

rawSymbolStore
Byte[]

位元組陣列,包含表示組件符號的未經處理位元組。

securityContextSource
SecurityContextSource

安全性內容的來源。

傳回

載入的組件。

例外狀況

rawAssemblynull

rawAssembly 不是目前載入運行時間的有效元件。

securityContextSource 的值不是其中一個列舉值。

備註

元件會使用安全性內容的指定來源,載入呼叫端的應用程式域。 如果 rawSymbolStore 已指定,也會載入代表元件符號的原始位元組。

適用於

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

警告

This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of Load which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.

使用通用物件檔案格式 (COFF) 映像載入組件,其中包含已發出的組件,並可選擇性地包含組件的符號和辨識項。

public:
 static System::Reflection::Assembly ^ Load(cli::array <System::Byte> ^ rawAssembly, cli::array <System::Byte> ^ rawSymbolStore, System::Security::Policy::Evidence ^ securityEvidence);
public static System.Reflection.Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore, System.Security.Policy.Evidence securityEvidence);
[System.Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of Load which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
public static System.Reflection.Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore, System.Security.Policy.Evidence securityEvidence);
static member Load : byte[] * byte[] * System.Security.Policy.Evidence -> System.Reflection.Assembly
[<System.Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of Load which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")>]
static member Load : byte[] * byte[] * System.Security.Policy.Evidence -> System.Reflection.Assembly
Public Shared Function Load (rawAssembly As Byte(), rawSymbolStore As Byte(), securityEvidence As Evidence) As Assembly

參數

rawAssembly
Byte[]

位元組陣列,該陣列是以 COFF 為基礎的影像,其中包含發出的組件。

rawSymbolStore
Byte[]

位元組陣列,包含表示組件符號的未經處理位元組。

securityEvidence
Evidence

用於載入組件的辨識項。

傳回

載入的組件。

屬性

例外狀況

rawAssemblynull

rawAssembly 不是目前載入運行時間的有效元件。

使用兩個不同的辨識項載入組件或模組兩次。

securityEvidence 不是 null。 根據預設,在 .NET Framework 4 中未啟用舊版 CAS 原則;如果未啟用,securityEvidence則必須是 null

備註

這個方法多載一律會在自己的隔離載入內容中建立新的 Assembly 物件。

元件會使用提供的辨識項載入。 也會載入代表元件符號的原始位元組。

是否將某些使用權限授予組件則以辨識項 (Evidence) 為基礎。 元件和安全性辨識項合併的規則如下:

  • 當您使用 Load 不含 Evidence 參數的方法時,元件會以載入器所提供的辨識項載入。

  • 當您搭配Evidence參數使用Load方法時,會合併辨識項片段。 當做自變數 Load 提供給方法的辨識項片段取代載入器所提供的辨識項片段。

  • 當您搭配參數使用 Load 方法多載 Byte[] 來載入 COFF 影像時,辨識項會繼承自呼叫元件。

  • 當您搭配Byte[]參數使用 Load 方法並Evidence載入 COFF 影像時,只會使用提供的辨識項。 會忽略呼叫元件和 COFF 影像辨識項的辨識項。

如果您在相同元件上多次呼叫 Load 方法,但指定不同的辨識項時,Common Language Runtime 不會擲回 FileLoadException ,因為無法判斷不同辨識項規格的相等性和完整性。 第一個成功的辨識項是所使用的辨識項。

適用於

Load(String, Evidence)

警告

This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of Load which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.

載入元件,指定其顯示名稱,並使用提供的辨識項。

public:
 static System::Reflection::Assembly ^ Load(System::String ^ assemblyString, System::Security::Policy::Evidence ^ assemblySecurity);
public static System.Reflection.Assembly Load (string assemblyString, System.Security.Policy.Evidence assemblySecurity);
[System.Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of Load which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
public static System.Reflection.Assembly Load (string assemblyString, System.Security.Policy.Evidence assemblySecurity);
static member Load : string * System.Security.Policy.Evidence -> System.Reflection.Assembly
[<System.Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of Load which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")>]
static member Load : string * System.Security.Policy.Evidence -> System.Reflection.Assembly
Public Shared Function Load (assemblyString As String, assemblySecurity As Evidence) As Assembly

參數

assemblyString
String

組件的顯示名稱。

assemblySecurity
Evidence

用於載入組件的辨識項。

傳回

載入的組件。

屬性

例外狀況

assemblyStringnull

找不到 assemblyString

assemblyString 不是目前載入運行時間的有效元件。

無法載入找到的檔案。

-或-

使用兩個不同的辨識項載入組件或模組兩次。

備註

FileLoadException 如果 assemblyString 指定完整元件名稱,而符合簡單名稱的第一個元件具有不同的版本、文化特性或公鑰令牌,則會擲回 。 載入器不會繼續探查符合簡單名稱的其他元件。

是否將某些使用權限授予組件則以辨識項 (Evidence) 為基礎。 元件和安全性辨識項合併的規則如下:

  • 當您使用 Load 不含 Evidence 參數的方法時,元件會以載入器所提供的辨識項載入。

  • 當您搭配Evidence參數使用Load方法時,會合併辨識項片段。 當做自變數 Load 提供給方法的辨識項片段取代載入器所提供的辨識項片段。

  • 當您使用 Load 方法多載搭配 Byte[] 參數載入通用物件檔格式 (COFF) 影像時,辨識項會繼承自呼叫元件。

  • 當您搭配Byte[]參數使用 Load 方法並Evidence載入 COFF 影像時,只會使用提供的辨識項。 會忽略呼叫元件和 COFF 影像辨識項的辨識項。

如果您在相同元件上多次呼叫這個方法,但指定不同的辨識項時,Common Language Runtime 不會擲回 FileLoadException ,因為無法判斷不同辨識項規格的相等性和完整性。 第一個成功的辨識項是所使用的辨識項。

在 .NET Framework 2.0 版中,處理器架構會新增至元件識別,而且可以指定為元件名稱字串的一部分。 例如,“ProcessorArchitecture=msil”。 不過,指定元件名稱的建議方式是建立 AssemblyName 物件,並將它傳遞至方法的適當 Load 多載。 請參閱 AssemblyName.ProcessorArchitecture

另請參閱

適用於

Load(AssemblyName, Evidence)

警告

This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of Load which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.

載入組件,指定其 AssemblyName。 元件會使用提供的辨識項載入。

public:
 static System::Reflection::Assembly ^ Load(System::Reflection::AssemblyName ^ assemblyRef, System::Security::Policy::Evidence ^ assemblySecurity);
public static System.Reflection.Assembly Load (System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity);
[System.Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of Load which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
public static System.Reflection.Assembly Load (System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity);
static member Load : System.Reflection.AssemblyName * System.Security.Policy.Evidence -> System.Reflection.Assembly
[<System.Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of Load which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")>]
static member Load : System.Reflection.AssemblyName * System.Security.Policy.Evidence -> System.Reflection.Assembly
Public Shared Function Load (assemblyRef As AssemblyName, assemblySecurity As Evidence) As Assembly

參數

assemblyRef
AssemblyName

描述要載入之組件的物件。

assemblySecurity
Evidence

用於載入組件的辨識項。

傳回

載入的組件。

屬性

例外狀況

assemblyRefnull

找不到 assemblyRef

assemblyRef 不是目前載入運行時間的有效元件。

使用兩個不同的辨識項載入組件或模組兩次。

-或-

assemblyRef 指定遠端組件,但已停用在遠端組件中執行程式碼的能力。 請參閱 <loadFromRemoteSources>

備註

FileLoadException 如果 assemblyRef 指定完整元件名稱,而符合簡單名稱的第一個元件具有不同的版本、文化特性或公鑰令牌,則會擲回 。 載入器不會繼續探查符合簡單名稱的其他元件。 從 .NET Framework 4 開始,因為預設會停用遠端元件中的程式代碼執行,如果assemblyRef指定遠端元件,FileLoadException也會擲回 。 若要啟用從遠端位置載入的程式代碼執行,您可以使用 <loadFromRemoteSources> 組態專案。

注意

請勿只CodeBase搭配屬性集使用 AssemblyName 。 屬性 CodeBase 不會提供元件身分識別的任何元素 (,例如名稱或版本) ,因此載入不會根據依身分識別規則進行,因為您預期來自 Load 方法。 相反地,元件會使用來自規則的載入來載入。 如需使用從內容載入之缺點的資訊,請參閱 Assembly.LoadFrom 元件載入的方法多載或 最佳做法

是否將某些使用權限授予組件則以辨識項 (Evidence) 為基礎。 元件和安全性辨識項合併的規則如下:

  • 當您使用 Load 不含 Evidence 參數的方法時,元件會以載入器所提供的辨識項載入。

  • 當您搭配Evidence參數使用Load方法時,會合併辨識項片段。 當做自變數 Load 提供給方法的辨識項片段取代載入器所提供的辨識項片段。

  • 當您使用 Load 方法多載搭配 Byte[] 參數載入通用物件檔格式 (COFF) 影像時,辨識項會繼承自呼叫元件。

  • 當您搭配Byte[]參數使用 Load 方法並Evidence載入 COFF 影像時,只會使用提供的辨識項。 會忽略呼叫元件和 COFF 影像辨識項的辨識項。

注意

如果同時 AssemblyName.Name 設定 屬性和 AssemblyName.CodeBase 屬性,則第一次載入元件會使用顯示名稱 (包括版本、文化特性等,如屬性) 傳 Assembly.FullName 回。 如果找不到檔案, CodeBase 則會用來搜尋元件。 如果使用 找到 CodeBase元件,則會比對元件顯示名稱。 如果相符項目失敗, FileLoadException 則會擲回 。

如果您在相同元件上多次呼叫 Load 方法,但指定不同的辨識項時,Common Language Runtime 不會擲回 FileLoadException ,因為無法判斷不同辨識項規格的相等性和完整性。 第一個成功的辨識項是所使用的辨識項。

另請參閱

適用於

Load(Byte[])

來源:
Assembly.cs
來源:
Assembly.cs
來源:
Assembly.cs

載入具有通用物件檔案格式 (Common Object File Format,COFF) 之映像的組件 (包含發出的組件)。

public:
 static System::Reflection::Assembly ^ Load(cli::array <System::Byte> ^ rawAssembly);
public static System.Reflection.Assembly Load (byte[] rawAssembly);
static member Load : byte[] -> System.Reflection.Assembly
Public Shared Function Load (rawAssembly As Byte()) As Assembly

參數

rawAssembly
Byte[]

位元組陣列,該陣列是以 COFF 為基礎的影像,其中包含發出的組件。

傳回

載入的組件。

例外狀況

rawAssemblynull

rawAssembly 不是目前載入運行時間的有效元件。

備註

這個方法多載一律會在自己的隔離載入內容中建立新的 Assembly 物件。

僅 .NET Framework:使用此方法載入之元件的信任層級與呼叫元件的信任層級相同。 若要從具有應用程式域信任層級的位元組數位件,請使用 Load(Byte[], Byte[], SecurityContextSource) 方法多載。 如需使用辨識項搭配採用位元組數位化組之方法多載 Load 的詳細資訊,請參閱 Load(Byte[], Byte[], Evidence) 方法多載。

適用於

Load(String)

來源:
Assembly.CoreCLR.cs
來源:
Assembly.CoreCLR.cs
來源:
Assembly.CoreCLR.cs

載入具有指定名稱的組件。

public:
 static System::Reflection::Assembly ^ Load(System::String ^ assemblyString);
public static System.Reflection.Assembly Load (string assemblyString);
static member Load : string -> System.Reflection.Assembly
Public Shared Function Load (assemblyString As String) As Assembly

參數

assemblyString
String

組件名稱的完整或簡短形式。

傳回

載入的組件。

例外狀況

assemblyStringnull

assemblyString 是零長度字串

找不到 assemblyString

無法載入找到的檔案。

assemblyString 不是目前載入運行時間的有效元件。

範例

下列範例會載入指定元件的完整名稱,並列出指定元件中包含的所有類型。 如需如何取得完整元件名稱的詳細資訊,請參閱 元件名稱

using namespace System;
using namespace System::Collections;
using namespace System::Reflection;
int main()
{
    // You must supply a valid fully qualified assembly name.            
    Assembly^ SampleAssembly = Assembly::Load
        ( "SampleAssembly, Version=1.0.2004.0, Culture=neutral, PublicKeyToken=8744b20f8da049e3" );
    array<Type^>^ Types = SampleAssembly->GetTypes();
    
    // Display all the types contained in the specified assembly.
    IEnumerator^ myEnum = Types->GetEnumerator();
    Type^ oType;
    while ( myEnum->MoveNext() )
    {
        oType = safe_cast<Type^>(myEnum->Current);
        Console::WriteLine( oType->Name );
    }
}
using System;
using System.Reflection;

class Class1
{
    public static void Main()
    {
        // You must supply a valid fully qualified assembly name.
        Assembly SampleAssembly = Assembly.Load
            ("SampleAssembly, Version=1.0.2004.0, Culture=neutral, PublicKeyToken=8744b20f8da049e3");
        // Display all the types contained in the specified assembly.
        foreach (Type oType in SampleAssembly.GetTypes()) {
            Console.WriteLine(oType.Name);
        }
    }
}
Imports System.Reflection

Class Class1
    Public Shared Sub Main()
        ' You must supply a valid fully qualified assembly name.            
        Dim SampleAssembly As [Assembly] = _
            [Assembly].Load("SampleAssembly, Version=1.0.2004.0, Culture=neutral, PublicKeyToken=8744b20f8da049e3")
        Dim oType As Type
        ' Display all the types contained in the specified assembly.
        For Each oType In SampleAssembly.GetTypes()
            Console.WriteLine(oType.Name)
        Next oType
    End Sub	'LoadSample
End Class

備註

若要載入正確的元件,建議藉由傳遞元件名稱的長格式來呼叫 Load 方法。 元件名稱的長格式包含其簡單名稱 (,例如 System.dll 元件) 的 “System”,以及其版本、文化特性、公鑰令牌,以及選擇性的處理器架構。 它對應至元件的 FullName 屬性。 下列範例說明如何使用長名稱載入 .NET Framework 4 的 System.dll 元件:

using System;
using System.Reflection;

public class Example
{
   public static void Main()
   {
      string longName = "system, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
      Assembly assem = Assembly.Load(longName);
      if (assem == null)
         Console.WriteLine("Unable to load assembly...");
      else
         Console.WriteLine(assem.FullName);
   }
}
// The example displays the following output:
//        system, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Imports System.Reflection

Module Example
   Public Sub Main()
      Dim longName As String = "system, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
      Dim assem As Assembly = Assembly.Load(longName)
      If assem Is Nothing Then
         Console.WriteLine("Unable to load assembly...")
      Else
         Console.WriteLine(assem.FullName)
      End If
   End Sub
End Module
' The example displays the following output:
'       system, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

FileLoadException 如果 assemblyString 指定完整元件名稱,而符合簡單名稱的第一個元件具有不同的版本、文化特性或公鑰令牌,則會擲回 。 載入器不會繼續探查符合簡單名稱的其他元件。

在 .NET Framework 2.0 版中,處理器架構會新增至元件識別,並可指定為元件名稱字串的一部分。 例如,“ProcessorArchitecture=msil”。 不過,指定元件名稱的建議方式是建立 AssemblyName 物件,並將它傳遞至方法的適當 Load 多載。 請參閱 AssemblyName.ProcessorArchitecture

另請參閱

適用於

Load(AssemblyName)

來源:
Assembly.CoreCLR.cs
來源:
Assembly.CoreCLR.cs
來源:
Assembly.CoreCLR.cs

載入組件,指定其 AssemblyName

public:
 static System::Reflection::Assembly ^ Load(System::Reflection::AssemblyName ^ assemblyRef);
public static System.Reflection.Assembly Load (System.Reflection.AssemblyName assemblyRef);
static member Load : System.Reflection.AssemblyName -> System.Reflection.Assembly
Public Shared Function Load (assemblyRef As AssemblyName) As Assembly

參數

assemblyRef
AssemblyName

描述要載入之組件的物件。

傳回

載入的組件。

例外狀況

assemblyRefnull

找不到 assemblyRef

無法載入找到的檔案。

-或-

assemblyRef 指定遠端組件,但已停用在遠端組件中執行程式碼的能力。 請參閱 <loadFromRemoteSources>

注意:在 適用於 Windows 市集應用程式的 .NET可攜式類別庫中,改為攔截基類例外狀況 IOException

assemblyRef 不是目前載入運行時間的有效元件。

範例

下列範例會具現化 AssemblyName 物件,並用它來載入 sysglobal.dll 元件。 然後,此範例會顯示元件公用型別的完整名稱。

using System;
using System.Reflection;

public class Example
{
   public static void Main()
   {
      String fullName = "sysglobl, Version=4.0.0.0, Culture=neutral, " +
                        "PublicKeyToken=b03f5f7f11d50a3a, processor architecture=MSIL";
      var an = new AssemblyName(fullName);
      var assem = Assembly.Load(an);
      Console.WriteLine("Public types in assembly {0}:", assem.FullName);
      foreach (var t in assem.GetTypes())
         if (t.IsPublic)
            Console.WriteLine("   {0}", t.FullName);
   }
}
// The example displays the following output:
//   Public types in assembly sysglobl, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a:
//      System.Globalization.CultureAndRegionInfoBuilder
//      System.Globalization.CultureAndRegionModifiers
Imports System.Reflection

Module Example
   Public Sub Main()
      Dim fullName As String = "sysglobl, Version=4.0.0.0, Culture=neutral, " +
                               "PublicKeyToken=b03f5f7f11d50a3a, processor architecture=MSIL"
      Dim an As New AssemblyName(fullName)
      Dim assem As Assembly = Assembly.Load(an)
      Console.WriteLine("Public types in assembly {0}:", assem.FullName)
      For Each t As Type in assem.GetTypes()
         If t.IsPublic Then Console.WriteLine("   {0}", t.FullName)
      Next
   End Sub
End Module
' The example displays the following output:
'   Public types in assembly sysglobl, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a:
'      System.Globalization.CultureAndRegionInfoBuilder
'      System.Globalization.CultureAndRegionModifiers

備註

FileLoadException 如果 assemblyRef 指定完整元件名稱和符合簡單名稱的第一個元件具有不同的版本、文化特性或公鑰令牌,則會擲回 。 載入器不會繼續探查符合簡單名稱的其他元件。 從 .NET Framework 4 開始,因為預設會停用遠端元件中的程式代碼執行,如果assemblyRef指定遠端元件,FileLoadException也會擲回 。 若要啟用從遠端位置載入的程式代碼執行,您可以使用 <loadFromRemoteSources> 組態專案。

注意

請勿只CodeBase搭配屬性集使用 AssemblyName 。 屬性 CodeBase 不會提供元件身分識別的任何元素 (,例如名稱或版本) ,因此載入不會根據依身分識別規則進行,因為您預期來自 Load 方法。 相反地,元件會使用來自規則的載入來載入。 如需使用從內容載入之缺點的資訊,請參閱 Assembly.LoadFrom 元件載入的方法多載或 最佳做法

注意

如果同時 AssemblyName.Name 設定 屬性和 AssemblyName.CodeBase 屬性,則第一次載入元件會使用顯示名稱 (包括版本、文化特性等,如屬性) 傳 Assembly.FullName 回。 如果找不到檔案, CodeBase 則會用來搜尋元件。 如果使用 找到 CodeBase元件,則會比對元件顯示名稱。 如果相符項目失敗, FileLoadException 則會擲回 。

另請參閱

適用於

Load(Byte[], Byte[])

來源:
Assembly.cs
來源:
Assembly.cs
來源:
Assembly.cs

使用通用物件檔案格式 (COFF) 映像載入組件,其中包含已發出的組件,並可選擇性地包含組件的符號。

public:
 static System::Reflection::Assembly ^ Load(cli::array <System::Byte> ^ rawAssembly, cli::array <System::Byte> ^ rawSymbolStore);
public static System.Reflection.Assembly Load (byte[] rawAssembly, byte[]? rawSymbolStore);
public static System.Reflection.Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore);
static member Load : byte[] * byte[] -> System.Reflection.Assembly
Public Shared Function Load (rawAssembly As Byte(), rawSymbolStore As Byte()) As Assembly

參數

rawAssembly
Byte[]

位元組陣列,該陣列是以 COFF 為基礎的影像,其中包含發出的組件。

rawSymbolStore
Byte[]

位元組陣列,包含表示組件符號的未經處理位元組。

傳回

載入的組件。

例外狀況

rawAssemblynull

rawAssembly 不是目前載入運行時間的有效元件。

備註

這個方法多載一律會在自己的隔離載入內容中建立新的 Assembly 物件。

僅 .NET Framework:使用此方法載入之元件的信任層級與呼叫元件的信任層級相同。 若要從具有應用程式域信任層級的位元組數位件,請使用 Load(Byte[], Byte[], SecurityContextSource) 方法多載。 如需使用辨識項搭配採用位元組數位化組之方法多載 Load 的詳細資訊,請參閱 Load(Byte[], Byte[], Evidence) 方法多載。

適用於