System.Reflection.MetadataLoadContext 9.0.20

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.
142
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
143
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
153
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.
158
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
159
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.
177
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
178
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
181
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
183
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
184
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
185
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.
191
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
196
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
215
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
243

https://go.microsoft.com/fwlink/?LinkID=799421

.NET Framework 4.6.2

.NET 8.0

.NET 9.0

  • No dependencies.

.NET Standard 2.0

Version Downloads Last updated
11.0.0-rc.1.26425.128 7 09/10/2026
11.0.0-preview.7.26381.103 16 08/12/2026
11.0.0-preview.6.26359.118 20 07/16/2026
11.0.0-preview.5.26302.115 29 06/09/2026
11.0.0-preview.4.26230.115 23 05/13/2026
11.0.0-preview.3.26207.106 44 04/14/2026
11.0.0-preview.2.26159.112 48 03/11/2026
11.0.0-preview.1.26104.118 39 02/12/2026
10.0.12 5 09/10/2026
10.0.11 16 08/12/2026
10.0.10 21 07/16/2026
10.0.9 33 06/09/2026
10.0.8 36 05/13/2026
10.0.7 40 04/21/2026
10.0.6 38 04/14/2026
10.0.5 44 03/13/2026
10.0.4 45 03/11/2026
10.0.3 50 02/12/2026
10.0.2 60 01/13/2026
10.0.1 82 12/14/2025
10.0.0 92 11/12/2025
10.0.0-rc.2.25502.107 93 10/14/2025
10.0.0-rc.1.25451.107 136 09/10/2025
10.0.0-preview.7.25380.108 117 08/13/2025
10.0.0-preview.6.25358.103 127 07/16/2025
10.0.0-preview.5.25277.114 142 06/07/2025
10.0.0-preview.4.25258.110 143 05/16/2025
10.0.0-preview.3.25171.5 125 04/14/2025
10.0.0-preview.2.25163.2 120 04/02/2025
10.0.0-preview.1.25080.5 143 04/01/2025
9.0.20 6 09/10/2026
9.0.19 18 08/12/2026
9.0.18 21 07/16/2026
9.0.17 26 06/09/2026
9.0.16 24 05/13/2026
9.0.15 41 04/14/2026
9.0.14 48 03/11/2026
9.0.13 45 02/12/2026
9.0.12 58 01/13/2026
9.0.11 93 11/12/2025
9.0.10 91 10/14/2025
9.0.9 108 09/10/2025
9.0.8 129 08/05/2025
9.0.7 122 07/09/2025
9.0.6 130 06/12/2025
9.0.5 119 05/19/2025
9.0.4 151 04/09/2025
9.0.3 147 03/30/2025
9.0.2 126 03/30/2025
9.0.1 127 03/30/2025
9.0.0 148 11/14/2024
9.0.0-rc.2.24473.5 118 10/23/2024
9.0.0-rc.1.24431.7 134 09/19/2024
9.0.0-preview.7.24405.7 135 08/18/2024
9.0.0-preview.6.24327.7 147 07/19/2024
9.0.0-preview.5.24306.7 168 07/19/2024
9.0.0-preview.4.24266.19 161 07/19/2024
9.0.0-preview.3.24172.9 186 07/19/2024
9.0.0-preview.2.24128.5 179 07/19/2024
9.0.0-preview.1.24080.9 163 07/19/2024
8.0.1 123 10/22/2024
8.0.0 225 07/19/2024
8.0.0-rc.2.23479.6 157 07/19/2024
8.0.0-rc.1.23419.4 176 07/19/2024
8.0.0-preview.7.23375.6 152 07/19/2024
8.0.0-preview.6.23329.7 135 07/19/2024
8.0.0-preview.5.23280.8 160 07/19/2024
8.0.0-preview.4.23259.5 166 07/19/2024
8.0.0-preview.3.23174.8 147 07/19/2024
8.0.0-preview.2.23128.3 156 07/19/2024
8.0.0-preview.1.23110.8 194 07/19/2024
7.0.0 200 02/05/2024
7.0.0-rc.2.22472.3 158 07/19/2024
7.0.0-rc.1.22426.10 156 07/19/2024
7.0.0-preview.7.22375.6 178 07/19/2024
7.0.0-preview.6.22324.4 163 07/19/2024
7.0.0-preview.5.22301.12 156 07/19/2024
7.0.0-preview.4.22229.4 164 07/19/2024
7.0.0-preview.3.22175.4 145 07/19/2024
7.0.0-preview.2.22152.2 151 07/19/2024
7.0.0-preview.1.22076.8 176 07/19/2024
6.0.1 136 11/14/2024
6.0.0 180 02/04/2024
6.0.0-rc.2.21480.5 169 07/19/2024
6.0.0-rc.1.21451.13 161 07/19/2024
6.0.0-preview.7.21377.19 177 07/19/2024
6.0.0-preview.6.21352.12 170 07/19/2024
6.0.0-preview.5.21301.5 177 07/19/2024
6.0.0-preview.4.21253.7 150 07/19/2024
6.0.0-preview.3.21201.4 145 07/19/2024
6.0.0-preview.2.21154.6 145 07/19/2024
6.0.0-preview.1.21102.12 195 07/19/2024
5.0.1 160 07/19/2024
5.0.0 144 07/19/2024
5.0.0-rc.2.20475.5 193 07/19/2024
5.0.0-rc.1.20451.14 134 07/19/2024
5.0.0-preview.8.20407.11 135 07/19/2024
5.0.0-preview.7.20364.11 158 07/19/2024
5.0.0-preview.6.20305.6 193 07/19/2024
5.0.0-preview.5.20278.1 146 07/19/2024
5.0.0-preview.4.20251.6 146 07/19/2024
5.0.0-preview.3.20214.6 170 07/19/2024
5.0.0-preview.2.20160.6 155 07/19/2024
5.0.0-preview.1.20120.5 150 07/19/2024
4.7.2 157 07/19/2024
4.7.1 186 07/19/2024
4.7.0 166 07/19/2024
4.7.0-preview3.19551.4 166 07/19/2024
4.7.0-preview2.19523.17 158 07/19/2024
4.7.0-preview1.19504.10 164 07/19/2024
4.6.0 208 07/19/2024
4.6.0-rc1.19456.4 158 07/19/2024
4.6.0-preview9.19421.4 161 07/19/2024
4.6.0-preview9.19416.11 180 07/19/2024
4.6.0-preview8.19405.3 157 07/19/2024
4.6.0-preview7.19362.9 163 07/19/2024
4.6.0-preview6.19303.8 166 07/19/2024
4.6.0-preview6.19264.9 157 07/19/2024
4.6.0-preview5.19224.8 166 07/19/2024
4.6.0-preview4.19212.13 166 07/19/2024
4.6.0-preview3.19128.7 165 07/19/2024
4.6.0-preview.19073.11 152 07/19/2024
4.6.0-preview.18571.3 146 07/19/2024