Microsoft.Extensions.DependencyModel 11.0.0-preview.2.26159.112
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 |
|---|---|
|
IKVM
Java SE 8 Virtual Machine for .NET
|
2 |
|
NSwag.Commands
NSwag: The OpenAPI/Swagger API toolchain for .NET and TypeScript
|
2 |
|
Microsoft.EntityFrameworkCore.Design
Shared design-time components for Entity Framework Core tools.
|
2 |
|
Microsoft.EntityFrameworkCore.Sqlite.Core
SQLite database provider for Entity Framework Core. This package does not include a copy of the native SQLite library.
|
2 |
|
Microsoft.EntityFrameworkCore.Sqlite.Core
SQLite database provider for Entity Framework Core.
This package was built from the source code at https://github.com/aspnet/EntityFrameworkCore/tree/8e7402701ea1416b7fe55e1863ae65b3147c02c7
|
2 |
|
Serilog.Settings.Configuration
Microsoft.Extensions.Configuration (appsettings.json) support for Serilog.
|
2 |
|
Microsoft.Orleans.Sdk
Microsoft Orleans meta package to bring in the base Orleans packages for all project types.
|
1 |
|
Microsoft.Orleans.Server
Collection of Microsoft Orleans libraries and files needed on the server.
|
1 |
|
Microsoft.Orleans.Core
Core library of Microsoft Orleans used both on the client and server.
|
1 |
|
Microsoft.Orleans.Clustering.AzureStorage
Microsoft Orleans clustering provider backed by Azure Table Storage
|
1 |
|
Microsoft.EntityFrameworkCore.Sqlite.Core
SQLite database provider for Entity Framework Core. This package does not include a copy of the native SQLite library.
|
1 |
|
Serilog.Settings.Configuration
Microsoft.Extensions.Configuration (appsettings.json) support for Serilog.
|
1 |
|
IKVM
Java SE 8 Virtual Machine for .NET
|
1 |
.NET Framework 4.6.2
- System.Text.Encodings.Web (>= 11.0.0-preview.2.26159.112)
- System.Text.Json (>= 11.0.0-preview.2.26159.112)
- System.Buffers (>= 4.6.1)
- System.Memory (>= 4.6.3)
.NET 10.0
- System.Text.Encodings.Web (>= 11.0.0-preview.2.26159.112)
- System.Text.Json (>= 11.0.0-preview.2.26159.112)
.NET 11.0
- No dependencies.
.NET Standard 2.0
- System.Text.Encodings.Web (>= 11.0.0-preview.2.26159.112)
- System.Text.Json (>= 11.0.0-preview.2.26159.112)
- System.Buffers (>= 4.6.1)
- System.Memory (>= 4.6.3)