Microsoft.Extensions.DependencyInjection 9.0.7

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
HotChocolate.Execution
Package Description
4,758
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
4,326
HotChocolate.Execution
Package Description
4,302
HotChocolate.Utilities.DependencyInjection
Contains internal helper classes for Microsoft's dependency injection used by the Hot Chocolate GraphQL type system and the GraphQL query execution engine.
4,302
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
4,088
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
1,780
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
1,770
Cocona
Micro-framework for .NET console application. Cocona makes it easy and fast to build console applications on .NET.
1,770
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
1,740
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
1,180
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
516
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
512
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
509
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
508
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
504
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
503
HotChocolate.Execution
Package Description
492
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
295
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
218
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
189

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

Version Downloads Last updated
10.0.0-preview.5.25277.114 9 06/09/2025
10.0.0-preview.4.25258.110 12 05/15/2025
10.0.0-preview.3.25171.5 16 04/12/2025
10.0.0-preview.2.25163.2 17 03/23/2025
10.0.0-preview.1.25080.5 20 02/26/2025
9.0.7 1 07/10/2025
9.0.6 189 06/14/2025
9.0.5 13 05/16/2025
9.0.4 17 04/13/2025
9.0.3 18 03/15/2025
9.0.2 19 02/16/2025
9.0.1 23 01/19/2025
9.0.0 1,180 11/13/2024
9.0.0-rc.2.24473.5 27 10/17/2024
9.0.0-rc.1.24431.7 27 09/12/2024
9.0.0-preview.7.24405.7 33 08/15/2024
9.0.0-preview.6.24327.7 42 07/11/2024
9.0.0-preview.5.24306.7 38 06/14/2024
9.0.0-preview.4.24266.19 34 06/05/2024
9.0.0-preview.3.24172.9 38 04/13/2024
9.0.0-preview.2.24128.5 45 03/19/2024
9.0.0-preview.1.24080.9 43 02/16/2024
8.0.1 28 10/09/2024
8.0.0 4,331 11/17/2023
8.0.0-rc.2.23479.6 47 10/23/2023
8.0.0-rc.1.23419.4 55 09/14/2023
8.0.0-preview.7.23375.6 43 08/17/2023
8.0.0-preview.6.23329.7 41 07/21/2023
8.0.0-preview.5.23280.8 37 07/16/2023
8.0.0-preview.4.23259.5 52 05/29/2023
8.0.0-preview.3.23174.8 46 04/29/2023
8.0.0-preview.2.23128.3 502 07/04/2023
8.0.0-preview.1.23110.8 55 02/26/2023
7.0.0 512 11/15/2022
7.0.0-rc.2.22472.3 47 07/09/2023
7.0.0-rc.1.22426.10 53 11/30/2022
7.0.0-preview.7.22375.6 58 08/10/2022
7.0.0-preview.6.22324.4 66 05/19/2023
7.0.0-preview.5.22301.12 56 05/03/2023
7.0.0-preview.4.22229.4 46 07/03/2023
7.0.0-preview.3.22175.4 50 09/29/2022
7.0.0-preview.2.22152.2 52 09/28/2022
7.0.0-preview.1.22076.8 52 03/25/2023
6.0.2 28 11/13/2024
6.0.2-mauipre.1.22102.15 45 07/09/2022
6.0.2-mauipre.1.22054.8 50 03/26/2023
6.0.1 53 01/24/2023
6.0.0 1,783 11/09/2021
6.0.0-rc.2.21480.5 49 07/09/2023
6.0.0-rc.1.21451.13 47 05/04/2023
6.0.0-preview.7.21377.19 43 07/03/2023
6.0.0-preview.6.21352.12 46 07/11/2023
6.0.0-preview.5.21301.5 40 05/10/2023
6.0.0-preview.4.21253.7 60 11/22/2022
6.0.0-preview.3.21201.4 51 07/10/2023
6.0.0-preview.2.21154.6 43 07/12/2023
6.0.0-preview.1.21102.12 56 07/09/2023
5.0.2 60 07/19/2021
5.0.1 199 01/27/2021
5.0.0 200 01/26/2021
5.0.0-rc.2.20475.5 46 07/09/2023
5.0.0-rc.1.20451.14 52 07/08/2023
5.0.0-preview.8.20407.11 55 10/14/2022
5.0.0-preview.7.20364.11 43 07/01/2023
5.0.0-preview.6.20305.6 60 04/19/2023
5.0.0-preview.5.20278.1 55 05/05/2023
5.0.0-preview.4.20251.6 54 05/23/2023
5.0.0-preview.3.20215.2 58 07/03/2022
5.0.0-preview.2.20160.3 46 07/08/2023
5.0.0-preview.1.20120.4 47 05/18/2023
3.1.32 47 05/16/2023
3.1.31 38 04/07/2023
3.1.30 49 03/21/2023
3.1.29 40 01/21/2023
3.1.28 46 12/19/2022
3.1.27 45 09/22/2022
3.1.26 48 07/22/2022
3.1.25 43 05/12/2023
3.1.24 42 04/01/2023
3.1.23 42 07/05/2023
3.1.22 42 07/05/2023
3.1.21 41 11/05/2022
3.1.20 48 05/19/2023
3.1.19 50 06/20/2022
3.1.18 50 09/05/2022
3.1.17 50 03/17/2023
3.1.16 40 05/04/2023
3.1.15 36 04/04/2023
3.1.14 43 02/26/2023
3.1.13 41 11/05/2022
3.1.12 47 09/18/2022
3.1.11 47 02/02/2023
3.1.10 47 03/10/2023
3.1.9 47 12/18/2022
3.1.8 41 04/01/2023
3.1.7 51 11/10/2020
3.1.6 41 04/02/2023
3.1.5 65 10/04/2022
3.1.4 4,779 07/19/2021
3.1.3 48 03/29/2023
3.1.2 55 06/11/2022
3.1.1 47 07/25/2022
3.1.0 526 02/02/2021
3.1.0-preview3.19553.2 54 06/07/2022
3.1.0-preview2.19525.4 46 12/03/2022
3.1.0-preview1.19506.1 56 10/30/2022
3.0.3 50 09/28/2022
3.0.2 39 02/12/2023
3.0.1 46 12/29/2022
3.0.0 50 04/17/2023
3.0.0-rc1.19456.10 59 07/07/2023
3.0.0-preview9.19423.4 58 07/10/2023
3.0.0-preview8.19405.4 61 10/06/2022
3.0.0-preview7.19362.4 48 04/10/2023
3.0.0-preview6.19304.6 54 03/16/2023
3.0.0-preview5.19227.9 39 07/10/2023
3.0.0-preview4.19216.2 53 03/02/2023
3.0.0-preview3.19153.1 47 07/09/2023
3.0.0-preview.19074.2 43 07/17/2022
3.0.0-preview.18572.1 43 11/04/2022
2.2.0 45 07/12/2022
2.2.0-preview3-35497 56 09/04/2022
2.2.0-preview2-35157 52 05/24/2023
2.2.0-preview1-35029 49 02/01/2023
2.1.1 92 11/09/2020
2.1.0 80 11/01/2020
2.1.0-rc1-final 59 07/11/2023
2.1.0-preview2-final 64 11/19/2022
2.1.0-preview1-final 54 04/29/2023
2.0.0 50 06/07/2022
2.0.0-preview2-final 50 05/04/2023
2.0.0-preview1-final 45 07/01/2023
1.1.1 49 12/29/2022
1.1.0 39 03/02/2023
1.1.0-preview1-final 42 03/17/2023
1.0.2 45 03/18/2023
1.0.1 45 10/02/2022
1.0.0 48 09/01/2022
1.0.0-rc2-final 46 09/07/2022
1.0.0-rc1-final 54 03/19/2023