System.Reflection.MetadataLoadContext
10.0.0-preview.5.25277.101
See the version list below for details.
dotnet add package System.Reflection.MetadataLoadContext --version 10.0.0-preview.5.25277.101
NuGet\Install-Package System.Reflection.MetadataLoadContext -Version 10.0.0-preview.5.25277.101
<PackageReference Include="System.Reflection.MetadataLoadContext" Version="10.0.0-preview.5.25277.101" />
<PackageVersion Include="System.Reflection.MetadataLoadContext" Version="10.0.0-preview.5.25277.101" />
<PackageReference Include="System.Reflection.MetadataLoadContext" />
paket add System.Reflection.MetadataLoadContext --version 10.0.0-preview.5.25277.101
#r "nuget: System.Reflection.MetadataLoadContext, 10.0.0-preview.5.25277.101"
#addin nuget:?package=System.Reflection.MetadataLoadContext&version=10.0.0-preview.5.25277.101&prerelease
#tool nuget:?package=System.Reflection.MetadataLoadContext&version=10.0.0-preview.5.25277.101&prerelease
About
Provides read-only reflection on assemblies in an isolated context with support for assemblies that target different processor architectures and runtimes. Using MetadataLoadContext enables you to inspect assemblies without loading them into the main execution context. Assemblies in MetadataLoadContext are treated only as metadata, that is, you can read information about their members, but cannot execute any code contained in them.
How to Use
The following example shows how to print the list of types defined in an assembly.
using System;
using System.Reflection;
class Program
{
static void Main()
{
string inspectedAssembly = "Example.dll";
var resolver = new PathAssemblyResolver(new string[] {inspectedAssembly, typeof(object).Assembly.Location});
using var mlc = new MetadataLoadContext(resolver, typeof(object).Assembly.GetName().ToString());
// Load assembly into MetadataLoadContext
Assembly assembly = mlc.LoadFromAssemblyPath(inspectedAssembly);
AssemblyName name = assembly.GetName();
// Print types defined in assembly
Console.WriteLine($"{name.Name} has following types: ");
foreach (Type t in assembly.GetTypes())
{
Console.WriteLine(t.FullName);
}
}
}
Main Types
The main types provided by this library are:
System.Reflection.MetadataLoadContext
System.Reflection.MetadataAssemblyResolver
Additional Documentation
- How to: Inspect assembly contents using MetadataLoadContext
- System.Reflection.MetadataLoadContext
- System.Reflection.MetadataAssemblyResolver
Feedback & Contributing
System.Reflection.MetadataLoadContext is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- System.Collections.Immutable (>= 10.0.0-preview.5.25277.101)
- System.Memory (>= 4.6.3)
- System.Reflection.Metadata (>= 10.0.0-preview.5.25277.101)
-
.NETStandard 2.0
- System.Collections.Immutable (>= 10.0.0-preview.5.25277.101)
- System.Memory (>= 4.6.3)
- System.Reflection.Metadata (>= 10.0.0-preview.5.25277.101)
-
net10.0
- No dependencies.
-
net8.0
- System.Collections.Immutable (>= 10.0.0-preview.5.25277.101)
- System.Reflection.Metadata (>= 10.0.0-preview.5.25277.101)
-
net9.0
- System.Collections.Immutable (>= 10.0.0-preview.5.25277.101)
- System.Reflection.Metadata (>= 10.0.0-preview.5.25277.101)
GitHub repositories (29)
Showing the top 20 popular GitHub repositories that depend on System.Reflection.MetadataLoadContext:
Repository | Stars |
---|---|
dotnet/wpf
WPF is a .NET Core UI framework for building Windows desktop applications.
|
|
dotnet/msbuild
The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
|
|
Azure/azure-powershell
Microsoft Azure PowerShell
|
|
dotnet/samples
Sample code referenced by the .NET documentation
|
|
waf/CSharpRepl
A command line C# REPL with syntax highlighting – explore the language, libraries and nuget packages interactively.
|
|
dotnet/sdk
Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
|
|
dotnet/macios
.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
|
|
roslynpad/roslynpad
A cross-platform C# editor based on Roslyn and AvalonEdit
|
|
Pryaxis/TShock
☕️⚡️TShock provides Terraria servers with server-side characters, anti-cheat, and community management tools.
|
|
dotnet/wcf
This repo contains the client-oriented WCF libraries that enable applications built on .NET Core to communicate with WCF services.
|
|
ikvmnet/ikvm
A Java Virtual Machine and Bytecode-to-IL Converter for .NET
|
|
goatcorp/Dalamud
FFXIV plugin framework and API
|
|
WolvenKit/WolvenKit
Community Mod editor/creator for REDengine games.
|
|
microsoft/Microsoft.Unity.Analyzers
Roslyn analyzers for Unity game developers
|
|
elringus/bootsharp
Use C# in web apps with comfort
|
|
microsoft/node-api-dotnet
Advanced interoperability between .NET and JavaScript in the same process.
|
|
weikio/PluginFramework
Everything is a Plugin in .NET
|
|
microsoft/accessibility-insights-windows
Accessibility Insights for Windows
|
|
mono/t4
T4 text templating engine
|
|
merken/Prise
A .NET Plugin Framework.
|
Version | Downloads | Last updated |
---|---|---|
10.0.0-preview.5.25280.105 | 0 | 6/2/2025 |
10.0.0-preview.5.25277.114 | 0 | 6/3/2025 |
10.0.0-preview.5.25277.101 | 0 | 5/29/2025 |
10.0.0-preview.5.25266.103 | 0 | 5/20/2025 |
10.0.0-preview.4.25255.103 | 0 | 5/12/2025 |
4.6.0-preview.19073.11 | 2 | 1/28/2019 |
4.6.0-preview.18571.3 | 1 | 11/30/2018 |