Assembly.ReflectionOnlyLoad 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將組裝檔載入僅反映的上下文中,可檢視但無法執行。
多載
| 名稱 | Description |
|---|---|
| ReflectionOnlyLoad(Byte[]) |
已淘汰.
從包含所發出元件的通用物件檔案格式 (COFF) 型映射載入元件。 元件會載入呼叫端應用程式域的僅限反映內容。 |
| ReflectionOnlyLoad(String) |
已淘汰.
根據元件的顯示名稱,將元件載入僅限反映的內容。 |
ReflectionOnlyLoad(Byte[])
- 來源:
- Assembly.cs
- 來源:
- Assembly.cs
- 來源:
- 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);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")]
[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);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")]
public static System.Reflection.Assembly ReflectionOnlyLoad(byte[] rawAssembly);
public static System.Reflection.Assembly ReflectionOnlyLoad(byte[] rawAssembly);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")>]
[<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
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")>]
static member ReflectionOnlyLoad : byte[] -> System.Reflection.Assembly
static member ReflectionOnlyLoad : byte[] -> System.Reflection.Assembly
Public Shared Function ReflectionOnlyLoad (rawAssembly As Byte()) As Assembly
參數
- rawAssembly
- Byte[]
一個位元組陣列,是一個基於 COFF 的映像,包含一個已發射的組裝體。
傳回
裝填組件。
- 屬性
例外狀況
rawAssembly 是 null。
rawAssembly 在目前載入的執行時中,不是一個有效的組合語言。
rawAssembly 無法裝填。
僅限 .NET Core 和 .NET 5+:適用於所有情況。
備註
你無法從載入僅反射上下文的組合語言執行程式碼。 執行程式碼時,組合語言也必須透過該 Load 方法載入執行上下文。
純反思的情境與其他情境並無不同。 載入上下文的組件只能透過卸載應用程式域來卸載。
適用於
ReflectionOnlyLoad(String)
- 來源:
- Assembly.cs
- 來源:
- Assembly.cs
- 來源:
- Assembly.cs
- 來源:
- Assembly.cs
- 來源:
- Assembly.cs
警告
ReflectionOnly loading is not supported and throws PlatformNotSupportedException.
根據元件的顯示名稱,將元件載入僅限反映的內容。
public:
static System::Reflection::Assembly ^ ReflectionOnlyLoad(System::String ^ assemblyString);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")]
[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);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")]
public static System.Reflection.Assembly ReflectionOnlyLoad(string assemblyString);
public static System.Reflection.Assembly ReflectionOnlyLoad(string assemblyString);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")>]
[<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
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")>]
static member ReflectionOnlyLoad : string -> System.Reflection.Assembly
static member ReflectionOnlyLoad : string -> System.Reflection.Assembly
Public Shared Function ReflectionOnlyLoad (assemblyString As String) As Assembly
參數
傳回
裝填組件。
- 屬性
例外狀況
assemblyString 是 null。
assemblyString 是空字串(“”)。
找不到 assemblyString。
assemblyString 找到了,但無法裝填。
assemblyString 在目前載入的執行時中,不是一個有效的組合語言。
僅限 .NET Core 和 .NET 5+:適用於所有情況。
備註
相依關係不會自動載入僅反射的上下文中。
你無法從載入僅反射上下文的組合語言執行程式碼。 執行程式碼時,組合語言也必須透過該 Load 方法載入執行上下文。
純反思的情境與其他情境並無不同。 載入上下文的組件只能透過卸載應用程式域來卸載。