Assembly.ReflectionOnlyLoad Metodo

Definizione

Carica un assembly nel contesto di sola reflection, in cui può essere esaminato ma non eseguito.

Overload

Nome Descrizione
ReflectionOnlyLoad(Byte[])
Obsoleti.

Carica l'assembly da un'immagine basata su COFF (Common Object File Format) contenente un assembly generato. L'assembly viene caricato nel contesto di sola reflection del dominio applicazione del chiamante.

ReflectionOnlyLoad(String)
Obsoleti.

Carica un assembly nel contesto di sola reflection, in base al nome visualizzato.

ReflectionOnlyLoad(Byte[])

Origine:
Assembly.cs
Origine:
Assembly.cs
Origine:
Assembly.cs
Origine:
Assembly.cs
Origine:
Assembly.cs

Attenzione

ReflectionOnly loading is not supported and throws PlatformNotSupportedException.

Carica l'assembly da un'immagine basata su COFF (Common Object File Format) contenente un assembly generato. L'assembly viene caricato nel contesto di sola reflection del dominio applicazione del chiamante.

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

Parametri

rawAssembly
Byte[]

Matrice di byte che è un'immagine basata su COFF contenente un assembly generato.

Valori restituiti

Assembly caricato.

Attributi

Eccezioni

rawAssembly è null.

rawAssembly non è un assembly valido per il runtime attualmente caricato.

rawAssembly non può essere caricato.

Solo .NET Core e .NET 5+: in tutti i casi.

Commenti

Non è possibile eseguire codice da un assembly caricato nel contesto di sola reflection. Per eseguire il codice, l'assembly deve essere caricato anche nel contesto di esecuzione, usando il Load metodo .

Il contesto di sola reflection non è diverso da altri contesti. Gli assembly caricati nel contesto possono essere scaricati solo scaricando il dominio dell'applicazione.

Si applica a

ReflectionOnlyLoad(String)

Origine:
Assembly.cs
Origine:
Assembly.cs
Origine:
Assembly.cs
Origine:
Assembly.cs
Origine:
Assembly.cs

Attenzione

ReflectionOnly loading is not supported and throws PlatformNotSupportedException.

Carica un assembly nel contesto di sola reflection, in base al nome visualizzato.

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

Parametri

assemblyString
String

Nome visualizzato dell'assembly, come restituito dalla FullName proprietà .

Valori restituiti

Assembly caricato.

Attributi

Eccezioni

assemblyString è null.

assemblyString è una stringa vuota ("").

assemblyString non viene trovato.

assemblyString viene trovato, ma non può essere caricato.

assemblyString non è un assembly valido per il runtime attualmente caricato.

Solo .NET Core e .NET 5+: in tutti i casi.

Commenti

Le dipendenze non vengono caricate automaticamente nel contesto di sola reflection.

Non è possibile eseguire codice da un assembly caricato nel contesto di sola reflection. Per eseguire il codice, l'assembly deve essere caricato anche nel contesto di esecuzione, usando il Load metodo .

Il contesto di sola reflection non è diverso da altri contesti. Gli assembly caricati nel contesto possono essere scaricati solo scaricando il dominio dell'applicazione.

Si applica a