Microsoft.Extensions.DependencyModel 10.0.5
About
Provides abstractions for reading .deps files. When a .NET application is compiled, the SDK generates a JSON manifest file (<ApplicationName>.deps.json) that contains information about application dependencies. You can use Microsoft.Extensions.DependencyModel to read information from this manifest at run time. This is useful when you want to dynamically compile code (for example, using Roslyn Emit API) referencing the same dependencies as your main application.
By default, the dependency manifest contains information about the application's target framework and runtime dependencies. Set the PreserveCompilationContext project property to true to additionally include information about reference assemblies used during compilation.
How to Use
The following example shows how to display the list of assemblies used when compiling the current application. Include <PreserveCompilationContext>true</PreserveCompilationContext> in your project file to run this example.
using System;
using Microsoft.Extensions.DependencyModel;
class Program
{
static void Main()
{
Console.WriteLine("Compilation libraries:");
Console.WriteLine();
foreach (CompilationLibrary lib in DependencyContext.Default.CompileLibraries)
{
foreach (string path in lib.ResolveReferencePaths())
{
Console.WriteLine(path);
}
}
}
}
Additional Documentation
- .deps.json file format
- Microsoft.Extensions.DependencyModel namespace
- Microsoft.Extensions.DependencyModel.DependencyContext
Feedback & Contributing
Microsoft.Extensions.DependencyModel 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 Microsoft.Extensions.DependencyModel.
| Packages | Downloads |
|---|---|
|
NUnit3TestAdapter
The NUnit3 TestAdapter for Visual Studio, all versions from 2012 and onwards, and DotNet (incl. .Net core), versions .net framework 4.6.2 or higher, .net 8 or higher.
Note that this package ONLY contains the adapter, not the NUnit framework.
For VS 2017 and forward, you should add this package to every test project in your solution. (Earlier versions only require a single adapter package per solution.)
|
3 |
|
Microsoft.Orleans.Streaming.AzureStorage
Microsoft Orleans streaming provider backed by Azure Queue Storage
|
3 |
|
Microsoft.Orleans.Reminders.AzureStorage
Microsoft Orleans reminders provider backed by Azure Table Storage
|
3 |
|
Microsoft.Orleans.Clustering.AzureStorage
Microsoft Orleans clustering provider backed by Azure Table Storage
|
3 |
|
xunit.runner.visualstudio
Visual Studio 2012+ Test Explorer runner for the xUnit.net framework. Capable of running xUnit.net v1.9.2 and v2.0+ tests. Supports .NET 2.0 or later, .NET Core 1.0 or later, and Universal Windows 10.0 or later.
|
3 |
|
xunit.runner.visualstudio
Visual Studio 2012+ Test Explorer runner for the xUnit.net framework. Capable of running xUnit.net v1.9.2 and v2.0+ tests.
Supported platforms:
- Desktop .NET 2.0+
- .NET Core (including ASP.NET Core) 1.0+
- Universal Windows App 10+
|
3 |
|
Serilog.Settings.Configuration
Microsoft.Extensions.Configuration (appsettings.json) support for Serilog.
|
3 |
|
NSwag.Commands
NSwag: The OpenAPI/Swagger API toolchain for .NET and TypeScript
|
3 |
.NET Framework 4.6.2
- System.Text.Encodings.Web (>= 10.0.5)
- System.Text.Json (>= 10.0.5)
- System.Buffers (>= 4.6.1)
- System.Memory (>= 4.6.3)
.NET 8.0
- System.Text.Encodings.Web (>= 10.0.5)
- System.Text.Json (>= 10.0.5)
.NET 9.0
- System.Text.Encodings.Web (>= 10.0.5)
- System.Text.Json (>= 10.0.5)
.NET 10.0
- No dependencies.
.NET Standard 2.0
- System.Text.Encodings.Web (>= 10.0.5)
- System.Text.Json (>= 10.0.5)
- System.Buffers (>= 4.6.1)
- System.Memory (>= 4.6.3)