Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Loads an assembly into the reflection-only context, where it can be examined but not executed.
ReflectionOnlyLoad(Byte[]) |
Obsolete.
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) |
Obsolete.
Loads an assembly into the reflection-only context, given its display name. |
Caution
ReflectionOnly loading is not supported and throws PlatformNotSupportedException.
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.
public:
static System::Reflection::Assembly ^ ReflectionOnlyLoad(cli::array <System::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);
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}")>]
static member ReflectionOnlyLoad : byte[] -> System.Reflection.Assembly
static member ReflectionOnlyLoad : byte[] -> System.Reflection.Assembly
Public Shared Function ReflectionOnlyLoad (rawAssembly As Byte()) As Assembly
A byte array that is a COFF-based image containing an emitted assembly.
The loaded assembly.
rawAssembly
is null
.
rawAssembly
is not a valid assembly for the currently loaded runtime.
rawAssembly
cannot be loaded.
.NET Core and .NET 5+ only: In all cases.
You cannot execute code from an assembly loaded into the reflection-only context. To execute code, the assembly must be loaded into the execution context as well, using the Load method.
The reflection-only context is no different from other contexts. Assemblies that are loaded into the context can be unloaded only by unloading the application domain.
Product | Versions (Obsolete) |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5 (6, 7, 8, 9, 10) |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
Caution
ReflectionOnly loading is not supported and throws PlatformNotSupportedException.
Loads an assembly into the reflection-only context, given its display name.
public:
static System::Reflection::Assembly ^ ReflectionOnlyLoad(System::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);
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}")>]
static member ReflectionOnlyLoad : string -> System.Reflection.Assembly
static member ReflectionOnlyLoad : string -> System.Reflection.Assembly
Public Shared Function ReflectionOnlyLoad (assemblyString As String) As Assembly
The loaded assembly.
assemblyString
is null
.
assemblyString
is an empty string ("").
assemblyString
is not found.
assemblyString
is found, but cannot be loaded.
assemblyString
is not a valid assembly for the currently loaded runtime.
.NET Core and .NET 5+ only: In all cases.
Dependencies are not automatically loaded into the reflection-only context.
You cannot execute code from an assembly loaded into the reflection-only context. To execute code, the assembly must be loaded into the execution context as well, using the Load method.
The reflection-only context is no different from other contexts. Assemblies that are loaded into the context can be unloaded only by unloading the application domain.
Product | Versions (Obsolete) |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5 (6, 7, 8, 9, 10) |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in