System.Reflection.MetadataLoadContext 10.0.0

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

Feedback & Contributing

System.Reflection.MetadataLoadContext is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Showing the top 20 packages that depend on System.Reflection.MetadataLoadContext.

Packages Downloads
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
150
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
137
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
126
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
123
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
122
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
121
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
116
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
114
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
109
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
108
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
104
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
93
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
88
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
85
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
82
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
79
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
74
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
73
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
69

.NET Framework 4.6.2

.NET 8.0

.NET 9.0

.NET 10.0

  • No dependencies.

.NET Standard 2.0

Version Downloads Last updated
10.0.0 17 11/12/2025
10.0.0-rc.2.25502.107 31 10/15/2025
10.0.0-rc.1.25451.107 35 9/12/2025
10.0.0-preview.7.25380.108 33 8/13/2025
10.0.0-preview.6.25358.103 44 7/19/2025
10.0.0-preview.5.25277.114 45 6/8/2025
10.0.0-preview.4.25258.110 52 5/16/2025
10.0.0-preview.3.25171.5 64 4/12/2025
10.0.0-preview.2.25163.2 63 3/21/2025
10.0.0-preview.1.25080.5 58 2/28/2025
9.0.11 20 11/12/2025
9.0.10 34 10/15/2025
9.0.9 31 9/12/2025
9.0.8 44 8/7/2025
9.0.7 38 7/13/2025
9.0.6 41 6/15/2025
9.0.5 42 5/17/2025
9.0.4 48 4/9/2025
9.0.3 51 3/14/2025
9.0.2 73 2/14/2025
9.0.1 69 1/17/2025
9.0.0 61 11/13/2024
9.0.0-rc.2.24473.5 75 10/8/2024
9.0.0-rc.1.24431.7 63 9/12/2024
9.0.0-preview.7.24405.7 80 8/13/2024
9.0.0-preview.6.24327.7 83 7/10/2024
9.0.0-preview.5.24306.7 81 6/12/2024
9.0.0-preview.4.24266.19 76 6/5/2024
9.0.0-preview.3.24172.9 79 4/12/2024
9.0.0-preview.2.24128.5 87 3/20/2024
9.0.0-preview.1.24080.9 77 2/24/2024
8.0.1 67 10/25/2024
8.0.0 79 11/17/2023
8.0.0-rc.2.23479.6 84 10/18/2023
8.0.0-rc.1.23419.4 86 9/24/2023
8.0.0-preview.7.23375.6 98 8/23/2023
8.0.0-preview.6.23329.7 91 8/2/2023
8.0.0-preview.5.23280.8 80 7/22/2023
8.0.0-preview.4.23259.5 80 8/4/2023
8.0.0-preview.3.23174.8 88 5/14/2023
8.0.0-preview.2.23128.3 79 5/17/2023
8.0.0-preview.1.23110.8 87 2/23/2023
7.0.0 91 11/27/2022
7.0.0-rc.2.22472.3 87 12/5/2022
7.0.0-rc.1.22426.10 83 9/17/2022
7.0.0-preview.7.22375.6 93 9/17/2022
7.0.0-preview.6.22324.4 84 9/17/2022
7.0.0-preview.5.22301.12 102 9/17/2022
7.0.0-preview.4.22229.4 94 9/17/2022
7.0.0-preview.3.22175.4 93 9/17/2022
7.0.0-preview.2.22152.2 108 9/17/2022
7.0.0-preview.1.22076.8 103 9/17/2022
6.0.2-mauipre.1.22102.15 101 9/17/2022
6.0.2-mauipre.1.22054.8 104 9/17/2022
6.0.1 64 11/14/2024
6.0.0 106 9/17/2022
6.0.0-rc.2.21480.5 95 9/17/2022
6.0.0-rc.1.21451.13 102 9/17/2022
6.0.0-preview.7.21377.19 88 9/17/2022
6.0.0-preview.6.21352.12 81 9/17/2022
6.0.0-preview.5.21301.5 87 9/17/2022
6.0.0-preview.4.21253.7 88 9/17/2022
6.0.0-preview.3.21201.4 96 9/17/2022
6.0.0-preview.2.21154.6 85 9/17/2022
6.0.0-preview.1.21102.12 83 9/17/2022
5.0.1 77 9/17/2022
5.0.0 100 9/17/2022
5.0.0-rc.2.20475.5 80 9/17/2022
5.0.0-rc.1.20451.14 81 9/17/2022
5.0.0-preview.8.20407.11 87 9/17/2022
5.0.0-preview.7.20364.11 86 9/17/2022
5.0.0-preview.6.20305.6 80 9/17/2022
5.0.0-preview.5.20278.1 85 9/17/2022
5.0.0-preview.4.20251.6 83 9/17/2022
5.0.0-preview.3.20214.6 89 9/17/2022
5.0.0-preview.2.20160.6 94 9/17/2022
5.0.0-preview.1.20120.5 85 9/17/2022
4.7.2 87 9/17/2022
4.7.1 85 9/17/2022
4.7.0 85 9/17/2022
4.7.0-preview3.19551.4 98 9/17/2022
4.7.0-preview2.19523.17 92 9/17/2022
4.7.0-preview1.19504.10 88 9/17/2022
4.6.0 86 9/17/2022
4.6.0-rc1.19456.4 82 9/17/2022
4.6.0-preview9.19421.4 85 9/17/2022
4.6.0-preview9.19416.11 94 9/17/2022
4.6.0-preview8.19405.3 93 9/17/2022
4.6.0-preview7.19362.9 85 9/17/2022
4.6.0-preview6.19303.8 83 9/17/2022
4.6.0-preview6.19264.9 89 9/17/2022
4.6.0-preview5.19224.8 92 9/17/2022
4.6.0-preview4.19212.13 78 9/17/2022
4.6.0-preview3.19128.7 87 9/17/2022
4.6.0-preview.19073.11 87 9/17/2022
4.6.0-preview.18571.3 84 9/17/2022