System.Reflection.MetadataLoadContext 10.0.15

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.
204
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
187
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
176
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
175
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
173
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
171
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
168
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
163
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
158
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
154
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
151
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
135
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
134
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
133
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
131
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.
120

.NET Framework 4.6.2

.NET 8.0

.NET 9.0

.NET 10.0

  • No dependencies.

.NET Standard 2.0

Version Downloads Last updated
11.0.0 6 11/10/2026
11.0.0-rc.3.26522.148 8 10/26/2026
11.0.0-rc.2.26504.105 16 10/14/2026
11.0.0-rc.1.26425.128 20 9/10/2026
11.0.0-preview.7.26381.103 27 8/13/2026
11.0.0-preview.6.26359.118 28 7/17/2026
11.0.0-preview.5.26302.115 30 6/13/2026
11.0.0-preview.4.26230.115 40 5/13/2026
11.0.0-preview.3.26207.106 38 5/5/2026
11.0.0-preview.2.26159.112 45 3/12/2026
11.0.0-preview.1.26104.118 42 2/11/2026
10.0.15 4 11/10/2026
10.0.14 11 10/26/2026
10.0.13 13 10/14/2026
10.0.12 19 9/10/2026
10.0.11 27 8/13/2026
10.0.10 27 7/17/2026
10.0.9 33 6/13/2026
10.0.8 40 5/13/2026
10.0.7 33 5/5/2026
10.0.6 38 5/3/2026
10.0.5 44 3/18/2026
10.0.4 38 3/12/2026
10.0.3 44 2/11/2026
10.0.2 43 1/21/2026
10.0.1 54 12/14/2025
10.0.0 71 11/12/2025
10.0.0-rc.2.25502.107 76 10/15/2025
10.0.0-rc.1.25451.107 81 9/12/2025
10.0.0-preview.7.25380.108 84 8/13/2025
10.0.0-preview.6.25358.103 88 7/19/2025
10.0.0-preview.5.25277.114 87 6/8/2025
10.0.0-preview.4.25258.110 90 5/16/2025
10.0.0-preview.3.25171.5 116 4/12/2025
10.0.0-preview.2.25163.2 112 3/21/2025
10.0.0-preview.1.25080.5 103 2/28/2025
9.0.23 3 11/10/2026
9.0.22 13 10/26/2026
9.0.21 10 10/14/2026
9.0.20 20 9/10/2026
9.0.19 23 8/15/2026
9.0.18 31 7/17/2026
9.0.17 35 6/13/2026
9.0.16 35 5/13/2026
9.0.15 39 5/3/2026
9.0.14 37 3/12/2026
9.0.13 43 2/11/2026
9.0.12 49 1/21/2026
9.0.11 74 11/12/2025
9.0.10 74 10/15/2025
9.0.9 83 9/12/2025
9.0.8 82 8/7/2025
9.0.7 85 7/13/2025
9.0.6 86 6/15/2025
9.0.5 92 5/17/2025
9.0.4 91 4/9/2025
9.0.3 91 3/14/2025
9.0.2 124 2/14/2025
9.0.1 106 1/17/2025
9.0.0 100 11/13/2024
9.0.0-rc.2.24473.5 120 10/8/2024
9.0.0-rc.1.24431.7 100 9/12/2024
9.0.0-preview.7.24405.7 120 8/13/2024
9.0.0-preview.6.24327.7 124 7/10/2024
9.0.0-preview.5.24306.7 121 6/12/2024
9.0.0-preview.4.24266.19 118 6/5/2024
9.0.0-preview.3.24172.9 112 4/12/2024
9.0.0-preview.2.24128.5 132 3/20/2024
9.0.0-preview.1.24080.9 113 2/24/2024
8.0.1 104 10/25/2024
8.0.0 116 11/17/2023
8.0.0-rc.2.23479.6 126 10/18/2023
8.0.0-rc.1.23419.4 130 9/24/2023
8.0.0-preview.7.23375.6 132 8/23/2023
8.0.0-preview.6.23329.7 134 8/2/2023
8.0.0-preview.5.23280.8 118 7/22/2023
8.0.0-preview.4.23259.5 118 8/4/2023
8.0.0-preview.3.23174.8 132 5/14/2023
8.0.0-preview.2.23128.3 116 5/17/2023
8.0.0-preview.1.23110.8 128 2/23/2023
7.0.0 130 11/27/2022
7.0.0-rc.2.22472.3 126 12/5/2022
7.0.0-rc.1.22426.10 119 9/17/2022
7.0.0-preview.7.22375.6 125 9/17/2022
7.0.0-preview.6.22324.4 129 9/17/2022
7.0.0-preview.5.22301.12 145 9/17/2022
7.0.0-preview.4.22229.4 135 9/17/2022
7.0.0-preview.3.22175.4 134 9/17/2022
7.0.0-preview.2.22152.2 147 9/17/2022
7.0.0-preview.1.22076.8 147 9/17/2022
6.0.2-mauipre.1.22102.15 137 9/17/2022
6.0.2-mauipre.1.22054.8 140 9/17/2022
6.0.1 105 11/14/2024
6.0.0 140 9/17/2022
6.0.0-rc.2.21480.5 128 9/17/2022
6.0.0-rc.1.21451.13 139 9/17/2022
6.0.0-preview.7.21377.19 123 9/17/2022
6.0.0-preview.6.21352.12 122 9/17/2022
6.0.0-preview.5.21301.5 122 9/17/2022
6.0.0-preview.4.21253.7 128 9/17/2022
6.0.0-preview.3.21201.4 145 9/17/2022
6.0.0-preview.2.21154.6 124 9/17/2022
6.0.0-preview.1.21102.12 127 9/17/2022
5.0.1 112 9/17/2022
5.0.0 140 9/17/2022
5.0.0-rc.2.20475.5 123 9/17/2022
5.0.0-rc.1.20451.14 120 9/17/2022
5.0.0-preview.8.20407.11 127 9/17/2022
5.0.0-preview.7.20364.11 123 9/17/2022
5.0.0-preview.6.20305.6 115 9/17/2022
5.0.0-preview.5.20278.1 121 9/17/2022
5.0.0-preview.4.20251.6 121 9/17/2022
5.0.0-preview.3.20214.6 129 9/17/2022
5.0.0-preview.2.20160.6 136 9/17/2022
5.0.0-preview.1.20120.5 121 9/17/2022
4.7.2 125 9/17/2022
4.7.1 122 9/17/2022
4.7.0 122 9/17/2022
4.7.0-preview3.19551.4 138 9/17/2022
4.7.0-preview2.19523.17 137 9/17/2022
4.7.0-preview1.19504.10 127 9/17/2022
4.6.0 121 9/17/2022
4.6.0-rc1.19456.4 121 9/17/2022
4.6.0-preview9.19421.4 129 9/17/2022
4.6.0-preview9.19416.11 135 9/17/2022
4.6.0-preview8.19405.3 129 9/17/2022
4.6.0-preview7.19362.9 123 9/17/2022
4.6.0-preview6.19303.8 121 9/17/2022
4.6.0-preview6.19264.9 123 9/17/2022
4.6.0-preview5.19224.8 136 9/17/2022
4.6.0-preview4.19212.13 116 9/17/2022
4.6.0-preview3.19128.7 130 9/17/2022
4.6.0-preview.19073.11 125 9/17/2022
4.6.0-preview.18571.3 127 9/17/2022