Microsoft.Extensions.DependencyModel 9.0.0
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 |
---|---|
FluentAssertions
A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or
BDD-style unit tests. Targets .NET Framework 4.5 and 4.7, as well as .NET Core 2.0, .NET Core 3.0, .NET Core 2.1, .NET Standard 1.3, 1.6, 2.0 and 2.1.
Supports the unit test frameworks MSTest, MSTest2, Gallio, NUnit, XUnit, MBUnit, MSpec, and NSpec.
|
596 |
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+
|
72 |
Serilog.Settings.Configuration
Microsoft.Extensions.Configuration (appsettings.json) support for Serilog.
|
57 |
Serilog.Settings.Configuration
Microsoft.Extensions.Configuration (appsettings.json) support for Serilog.
|
51 |
Serilog.Settings.Configuration
Microsoft.Extensions.Configuration (appsettings.json) support for Serilog.
|
50 |
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.
|
50 |
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+
|
48 |
Microsoft.AspNetCore.Mvc.Testing
Support for writing functional tests for MVC applications.
This package was built from the source code at https://github.com/aspnet/AspNetCore/tree/d27c0100bc8b9b93eb8102b097c20b40f7de9c49
|
47 |
Serilog.Settings.Configuration
Microsoft.Extensions.Configuration (appsettings.json) support for Serilog.
|
47 |
Serilog.Settings.Configuration
Microsoft.Extensions.Configuration (appsettings.json) support for Serilog.
|
46 |
Microsoft.AspNetCore.App
Provides a default set of APIs for building an ASP.NET Core application.
This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.
|
46 |
Serilog.Settings.Configuration
Microsoft.Extensions.Configuration (appsettings.json) support for Serilog.
|
45 |
Serilog.Settings.Configuration
Microsoft.Extensions.Configuration (appsettings.json) support for Serilog.
|
44 |
Serilog.Settings.Configuration
Microsoft.Extensions.Configuration (appsettings.json) support for Serilog.
|
43 |
.NET Framework 4.6.2
- System.Text.Encodings.Web (>= 9.0.0)
- System.Text.Json (>= 9.0.0)
- System.Buffers (>= 4.5.1)
- System.Memory (>= 4.5.5)
.NET 8.0
- System.Text.Encodings.Web (>= 9.0.0)
- System.Text.Json (>= 9.0.0)
.NET 9.0
- No dependencies.
.NET Standard 2.0
- System.Text.Encodings.Web (>= 9.0.0)
- System.Text.Json (>= 9.0.0)
- System.Buffers (>= 4.5.1)
- System.Memory (>= 4.5.5)