System.Reflection.MetadataLoadContext 10.0.11

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.
137
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
138
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
144
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
147
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
149
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
152
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.
160
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
167
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
170
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
174
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.
179
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.
184
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
190
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
209
Microsoft.Build
This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
238

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

.NET Framework 4.6.2

.NET Standard 2.0

.NET 10.0

  • No dependencies.

.NET 9.0

.NET 8.0

Version Downloads Last updated
11.0.0-preview.7.26381.103 3 08/12/2026
11.0.0-preview.6.26359.118 12 07/16/2026
11.0.0-preview.5.26302.115 22 06/09/2026
11.0.0-preview.4.26230.115 17 05/13/2026
11.0.0-preview.3.26207.106 37 04/14/2026
11.0.0-preview.2.26159.112 43 03/11/2026
11.0.0-preview.1.26104.118 34 02/12/2026
10.0.11 2 08/12/2026
10.0.10 15 07/16/2026
10.0.9 26 06/09/2026
10.0.8 29 05/13/2026
10.0.7 32 04/21/2026
10.0.6 30 04/14/2026
10.0.5 41 03/13/2026
10.0.4 39 03/11/2026
10.0.3 45 02/12/2026
10.0.2 51 01/13/2026
10.0.1 77 12/14/2025
10.0.0 83 11/12/2025
10.0.0-rc.2.25502.107 85 10/14/2025
10.0.0-rc.1.25451.107 127 09/10/2025
10.0.0-preview.7.25380.108 109 08/13/2025
10.0.0-preview.6.25358.103 122 07/16/2025
10.0.0-preview.5.25277.114 137 06/07/2025
10.0.0-preview.4.25258.110 140 05/16/2025
10.0.0-preview.3.25171.5 121 04/14/2025
10.0.0-preview.2.25163.2 113 04/02/2025
10.0.0-preview.1.25080.5 136 04/01/2025
9.0.19 3 08/12/2026
9.0.18 13 07/16/2026
9.0.17 17 06/09/2026
9.0.16 18 05/13/2026
9.0.15 36 04/14/2026
9.0.14 40 03/11/2026
9.0.13 39 02/12/2026
9.0.12 51 01/13/2026
9.0.11 86 11/12/2025
9.0.10 82 10/14/2025
9.0.9 101 09/10/2025
9.0.8 123 08/05/2025
9.0.7 116 07/09/2025
9.0.6 126 06/12/2025
9.0.5 111 05/19/2025
9.0.4 145 04/09/2025
9.0.3 141 03/30/2025
9.0.2 121 03/30/2025
9.0.1 121 03/30/2025
9.0.0 142 11/14/2024
9.0.0-rc.2.24473.5 110 10/23/2024
9.0.0-rc.1.24431.7 128 09/19/2024
9.0.0-preview.7.24405.7 130 08/18/2024
9.0.0-preview.6.24327.7 142 07/19/2024
9.0.0-preview.5.24306.7 163 07/19/2024
9.0.0-preview.4.24266.19 154 07/19/2024
9.0.0-preview.3.24172.9 181 07/19/2024
9.0.0-preview.2.24128.5 171 07/19/2024
9.0.0-preview.1.24080.9 158 07/19/2024
8.0.1 118 10/22/2024
8.0.0 220 07/19/2024
8.0.0-rc.2.23479.6 150 07/19/2024
8.0.0-rc.1.23419.4 171 07/19/2024
8.0.0-preview.7.23375.6 147 07/19/2024
8.0.0-preview.6.23329.7 129 07/19/2024
8.0.0-preview.5.23280.8 155 07/19/2024
8.0.0-preview.4.23259.5 161 07/19/2024
8.0.0-preview.3.23174.8 142 07/19/2024
8.0.0-preview.2.23128.3 149 07/19/2024
8.0.0-preview.1.23110.8 189 07/19/2024
7.0.0 195 02/05/2024
7.0.0-rc.2.22472.3 152 07/19/2024
7.0.0-rc.1.22426.10 148 07/19/2024
7.0.0-preview.7.22375.6 168 07/19/2024
7.0.0-preview.6.22324.4 152 07/19/2024
7.0.0-preview.5.22301.12 149 07/19/2024
7.0.0-preview.4.22229.4 156 07/19/2024
7.0.0-preview.3.22175.4 140 07/19/2024
7.0.0-preview.2.22152.2 143 07/19/2024
7.0.0-preview.1.22076.8 171 07/19/2024
6.0.1 130 11/14/2024
6.0.0 176 02/04/2024
6.0.0-rc.2.21480.5 164 07/19/2024
6.0.0-rc.1.21451.13 155 07/19/2024
6.0.0-preview.7.21377.19 169 07/19/2024
6.0.0-preview.6.21352.12 161 07/19/2024
6.0.0-preview.5.21301.5 172 07/19/2024
6.0.0-preview.4.21253.7 144 07/19/2024
6.0.0-preview.3.21201.4 140 07/19/2024
6.0.0-preview.2.21154.6 137 07/19/2024
6.0.0-preview.1.21102.12 190 07/19/2024
5.0.1 155 07/19/2024
5.0.0 138 07/19/2024
5.0.0-rc.2.20475.5 187 07/19/2024
5.0.0-rc.1.20451.14 128 07/19/2024
5.0.0-preview.8.20407.11 128 07/19/2024
5.0.0-preview.7.20364.11 151 07/19/2024
5.0.0-preview.6.20305.6 184 07/19/2024
5.0.0-preview.5.20278.1 140 07/19/2024
5.0.0-preview.4.20251.6 139 07/19/2024
5.0.0-preview.3.20214.6 165 07/19/2024
5.0.0-preview.2.20160.6 150 07/19/2024
5.0.0-preview.1.20120.5 145 07/19/2024
4.7.2 149 07/19/2024
4.7.1 179 07/19/2024
4.7.0 160 07/19/2024
4.7.0-preview3.19551.4 160 07/19/2024
4.7.0-preview2.19523.17 149 07/19/2024
4.7.0-preview1.19504.10 158 07/19/2024
4.6.0 200 07/19/2024
4.6.0-rc1.19456.4 149 07/19/2024
4.6.0-preview9.19421.4 153 07/19/2024
4.6.0-preview9.19416.11 174 07/19/2024
4.6.0-preview8.19405.3 152 07/19/2024
4.6.0-preview7.19362.9 156 07/19/2024
4.6.0-preview6.19303.8 161 07/19/2024
4.6.0-preview6.19264.9 152 07/19/2024
4.6.0-preview5.19224.8 158 07/19/2024
4.6.0-preview4.19212.13 162 07/19/2024
4.6.0-preview3.19128.7 159 07/19/2024
4.6.0-preview.19073.11 146 07/19/2024
4.6.0-preview.18571.3 141 07/19/2024