Microsoft.Extensions.DependencyInjection 10.0.0-preview.6.25358.103

About

Supports the dependency injection (DI) software design pattern which is a technique for achieving Inversion of Control (IoC) between classes and their dependencies.

Key Features

Provides an implementation of the DI interfaces found in the Microsoft.Extensions.DependencyInjection.Abstractions package.

How to Use

ServiceCollection services = new ();
services.AddSingleton<IMessageWriter, MessageWriter>();
using ServiceProvider provider = services.BuildServiceProvider();

// The code below, following the IoC pattern, is typically only aware of the IMessageWriter interface, not the implementation.
IMessageWriter messageWriter = provider.GetService<IMessageWriter>()!;
messageWriter.Write("Hello");

public interface IMessageWriter
{
    void Write(string message);
}

internal class MessageWriter : IMessageWriter
{
    public void Write(string message)
    {
        Console.WriteLine($"MessageWriter.Write(message: \"{message}\")");
    }
}

Main Types

The main types provided by this library are:

  • Microsoft.Extensions.DependencyInjection.DefaultServiceProviderFactory
  • Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions
  • Microsoft.Extensions.DependencyInjection.ServiceProvider

Additional Documentation

  • Microsoft.Extensions.DependencyInjection.Abstractions
  • Microsoft.Extensions.Hosting
  • Microsoft.Extensions.Options

Feedback & Contributing

Microsoft.Extensions.DependencyInjection 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.DependencyInjection.

Packages Downloads
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
113
Microsoft.EntityFrameworkCore
Entity Framework Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations. EF Core works with SQL Server, Azure SQL Database, SQLite, Azure Cosmos DB, MySQL, PostgreSQL, and other databases through a provider plugin API. Commonly Used Types: Microsoft.EntityFrameworkCore.DbContext Microsoft.EntityFrameworkCore.DbSet
110
Microsoft.EntityFrameworkCore
Entity Framework Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations. EF Core works with SQL Server, Azure SQL Database, SQLite, Azure Cosmos DB, MySQL, PostgreSQL, and other databases through a provider plugin API. Commonly Used Types: Microsoft.EntityFrameworkCore.DbContext Microsoft.EntityFrameworkCore.DbSet
94
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
90
Microsoft.EntityFrameworkCore
Entity Framework Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations. EF Core works with SQL Server, Azure SQL Database, SQLite, Azure Cosmos DB, MySQL, PostgreSQL, and other databases through a provider plugin API. Commonly Used Types: Microsoft.EntityFrameworkCore.DbContext Microsoft.EntityFrameworkCore.DbSet
84
Pomelo.EntityFrameworkCore.MySql
Pomelo's MySQL database provider for Entity Framework Core.
70
Microsoft.EntityFrameworkCore
Entity Framework Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations. EF Core works with SQL Server, Azure SQL Database, SQLite, Azure Cosmos DB, MySQL, PostgreSQL, and other databases through a provider plugin API. Commonly Used Types: Microsoft.EntityFrameworkCore.DbContext Microsoft.EntityFrameworkCore.DbSet
69
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging. When using NuGet 3.x this package requires at least version 3.4.
53
Microsoft.SemanticKernel.Core
Semantic Kernel core orchestration, runtime and functions. This package is automatically installed by 'Microsoft.SemanticKernel' package with other useful packages. Install this package manually only if you are selecting individual Semantic Kernel components.
40
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
40
Dapr.Client
This package contains the reference assemblies for developing services using Dapr.
39
Dapr.Common
Package Description
39
Dapr.AspNetCore
This package contains the reference assemblies for developing services using Dapr and AspNetCore.
35
Dapr.Common
Package Description
34
Microsoft.CodeAnalysis.Workspaces.MSBuild
.NET Compiler Platform ("Roslyn") support for analyzing MSBuild projects and solutions. This should be used with at least one of the following packages to add the appropriate language support: - Microsoft.CodeAnalysis.CSharp.Workspaces - Microsoft.CodeAnalysis.VisualBasic.Workspaces More details at https://aka.ms/roslyn-packages This package was built from the source at https://github.com/dotnet/roslyn/commit/75e79dace86b274327a1afe479228d82a06051a4.
34
TensorFlow.NET
Google's TensorFlow full binding in .NET Standard. Building, training and infering deep learning models. https://tensorflownet.readthedocs.io
33
Microsoft.EntityFrameworkCore
Entity Framework Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations. EF Core works with SQL Server, Azure SQL Database, SQLite, Azure Cosmos DB, MySQL, PostgreSQL, and other databases through a provider plugin API. Commonly Used Types: Microsoft.EntityFrameworkCore.DbContext Microsoft.EntityFrameworkCore.DbSet
32
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
32
TensorFlow.NET
Google's TensorFlow full binding in .NET Standard. Building, training and infering deep learning models. https://tensorflownet.readthedocs.io
31
Microsoft.CodeAnalysis.Workspaces.MSBuild
.NET Compiler Platform ("Roslyn") support for analyzing MSBuild projects and solutions. This should be used with at least one of the following packages to add the appropriate language support: - Microsoft.CodeAnalysis.CSharp.Workspaces - Microsoft.CodeAnalysis.VisualBasic.Workspaces More details at https://aka.ms/roslyn-packages This package was built from the source at https://github.com/dotnet/roslyn/commit/f99bb16a395e48a05520ba7af1549b20bfdeee36.
31

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

.NET Framework 4.6.2

.NET Standard 2.1

.NET Standard 2.0

.NET 10.0

.NET 8.0

.NET 9.0

Version Downloads Last updated
10.0.0-preview.6.25358.103 35 07/22/2025
9.0.7 29 07/22/2025
8.0.1 46 07/08/2025
8.0.0 94 07/07/2025
7.0.0-rc.1.22426.10 21 07/12/2025
7.0.0-preview.5.22301.12 24 07/11/2025
7.0.0-preview.4.22229.4 22 07/08/2025
6.0.1 116 07/07/2025
6.0.0 124 07/07/2025
6.0.0-rc.1.21451.13 29 07/12/2025
5.0.0 47 08/02/2025
3.1.24 27 07/11/2025
3.1.23 22 07/09/2025
3.1.8 28 07/09/2025