Assembly.ReflectionOnlyLoad 方法

定義

將組件載入僅限反映的內容中,以便在其中檢查組件但不執行組件。

多載

ReflectionOnlyLoad(Byte[])
已淘汰.

從以通用物件檔案格式 (COFF) 為基礎的映像 (包含發出的組件) 載入組件。 這個組件會載入呼叫端應用程式定義域之僅限反映的內容中。

ReflectionOnlyLoad(String)
已淘汰.

將組件載入僅限反映的內容中,並指定其顯示名稱。

ReflectionOnlyLoad(Byte[])

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

警告

ReflectionOnly loading is not supported and throws PlatformNotSupportedException.

從以通用物件檔案格式 (COFF) 為基礎的映像 (包含發出的組件) 載入組件。 這個組件會載入呼叫端應用程式定義域之僅限反映的內容中。

public:
 static System::Reflection::Assembly ^ ReflectionOnlyLoad(cli::array <System::Byte> ^ rawAssembly);
public static System.Reflection.Assembly ReflectionOnlyLoad (byte[] rawAssembly);
[System.Obsolete("ReflectionOnly loading is not supported and throws PlatformNotSupportedException.", DiagnosticId="SYSLIB0018", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static System.Reflection.Assembly ReflectionOnlyLoad (byte[] rawAssembly);
static member ReflectionOnlyLoad : byte[] -> System.Reflection.Assembly
[<System.Obsolete("ReflectionOnly loading is not supported and throws PlatformNotSupportedException.", DiagnosticId="SYSLIB0018", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member ReflectionOnlyLoad : byte[] -> System.Reflection.Assembly
Public Shared Function ReflectionOnlyLoad (rawAssembly As Byte()) As Assembly

參數

rawAssembly
Byte[]

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

傳回

載入的組件。

屬性

例外狀況

rawAssemblynull

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

無法載入 rawAssembly

僅限 .NET Core 與 .NET 5+:在所有情況下。

備註

您無法從載入至僅限反映內容的元件執行程式代碼。 若要執行程序代碼,也必須使用 Load 方法將元件載入執行內容。

僅限反映的內容與其他內容並無不同。 載入內容中的元件只能卸除應用程式域來卸除。

適用於

ReflectionOnlyLoad(String)

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

警告

ReflectionOnly loading is not supported and throws PlatformNotSupportedException.

將組件載入僅限反映的內容中,並指定其顯示名稱。

public:
 static System::Reflection::Assembly ^ ReflectionOnlyLoad(System::String ^ assemblyString);
public static System.Reflection.Assembly ReflectionOnlyLoad (string assemblyString);
[System.Obsolete("ReflectionOnly loading is not supported and throws PlatformNotSupportedException.", DiagnosticId="SYSLIB0018", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static System.Reflection.Assembly ReflectionOnlyLoad (string assemblyString);
static member ReflectionOnlyLoad : string -> System.Reflection.Assembly
[<System.Obsolete("ReflectionOnly loading is not supported and throws PlatformNotSupportedException.", DiagnosticId="SYSLIB0018", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member ReflectionOnlyLoad : string -> System.Reflection.Assembly
Public Shared Function ReflectionOnlyLoad (assemblyString As String) As Assembly

參數

assemblyString
String

組件的顯示名稱,如同 FullName 屬性所傳回。

傳回

載入的組件。

屬性

例外狀況

assemblyStringnull

assemblyString 為空字串 ("")。

找不到 assemblyString

找到 assemblyString,但無法載入。

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

僅限 .NET Core 與 .NET 5+:在所有情況下。

備註

相依性不會自動載入僅限反映的內容。

您無法從載入至僅限反映內容的元件執行程式代碼。 若要執行程序代碼,也必須使用 Load 方法將元件載入執行內容。

僅限反映的內容與其他內容並無不同。 載入內容中的元件只能卸除應用程式域來卸除。

適用於