Microsoft.Extensions.DependencyInjection 10.0.0

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
5,860
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
5,750
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
5,500
HotChocolate.Execution
Package Description
5,395
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.
5,395
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
2,908
Cocona
Micro-framework for .NET console application. Cocona makes it easy and fast to build console applications on .NET.
2,834
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
2,829
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
2,818
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
2,479
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
1,611
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
1,380
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
527
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
520
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
520
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
518
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
515
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
512
HotChocolate.Execution
Package Description
497
HotChocolate.Execution
Package Description
329

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

Version Downloads Last updated
10.0.0 131 11/12/2025
10.0.0-rc.2.25502.107 9 10/16/2025
10.0.0-rc.1.25451.107 11 09/11/2025
10.0.0-preview.7.25380.108 11 08/15/2025
10.0.0-preview.6.25358.103 15 07/16/2025
10.0.0-preview.5.25277.114 20 06/09/2025
10.0.0-preview.4.25258.110 26 05/15/2025
10.0.0-preview.3.25171.5 29 04/12/2025
10.0.0-preview.2.25163.2 26 03/23/2025
10.0.0-preview.1.25080.5 28 02/26/2025
9.0.11 6 11/13/2025
9.0.10 11 10/16/2025
9.0.9 6 09/11/2025
9.0.8 846 08/07/2025
9.0.7 1,380 07/10/2025
9.0.6 1,615 06/14/2025
9.0.5 23 05/16/2025
9.0.4 24 04/13/2025
9.0.3 27 03/15/2025
9.0.2 30 02/16/2025
9.0.1 32 01/19/2025
9.0.0 2,481 11/13/2024
9.0.0-rc.2.24473.5 36 10/17/2024
9.0.0-rc.1.24431.7 38 09/12/2024
9.0.0-preview.7.24405.7 44 08/15/2024
9.0.0-preview.6.24327.7 52 07/11/2024
9.0.0-preview.5.24306.7 47 06/14/2024
9.0.0-preview.4.24266.19 41 06/05/2024
9.0.0-preview.3.24172.9 48 04/13/2024
9.0.0-preview.2.24128.5 56 03/19/2024
9.0.0-preview.1.24080.9 58 02/16/2024
8.0.1 36 10/09/2024
8.0.0 5,754 11/17/2023
8.0.0-rc.2.23479.6 56 10/23/2023
8.0.0-rc.1.23419.4 66 09/14/2023
8.0.0-preview.7.23375.6 53 08/17/2023
8.0.0-preview.6.23329.7 52 07/21/2023
8.0.0-preview.5.23280.8 46 07/16/2023
8.0.0-preview.4.23259.5 62 05/29/2023
8.0.0-preview.3.23174.8 57 04/29/2023
8.0.0-preview.2.23128.3 512 07/04/2023
8.0.0-preview.1.23110.8 69 02/26/2023
7.0.0 525 11/15/2022
7.0.0-rc.2.22472.3 60 07/09/2023
7.0.0-rc.1.22426.10 64 11/30/2022
7.0.0-preview.7.22375.6 72 08/10/2022
7.0.0-preview.6.22324.4 76 05/19/2023
7.0.0-preview.5.22301.12 68 05/03/2023
7.0.0-preview.4.22229.4 55 07/03/2023
7.0.0-preview.3.22175.4 59 09/29/2022
7.0.0-preview.2.22152.2 63 09/28/2022
7.0.0-preview.1.22076.8 64 03/25/2023
6.0.2 37 11/13/2024
6.0.2-mauipre.1.22102.15 58 07/09/2022
6.0.2-mauipre.1.22054.8 61 03/26/2023
6.0.1 66 01/24/2023
6.0.0 2,830 11/09/2021
6.0.0-rc.2.21480.5 57 07/09/2023
6.0.0-rc.1.21451.13 54 05/04/2023
6.0.0-preview.7.21377.19 51 07/03/2023
6.0.0-preview.6.21352.12 55 07/11/2023
6.0.0-preview.5.21301.5 50 05/10/2023
6.0.0-preview.4.21253.7 69 11/22/2022
6.0.0-preview.3.21201.4 61 07/10/2023
6.0.0-preview.2.21154.6 56 07/12/2023
6.0.0-preview.1.21102.12 68 07/09/2023
5.0.2 72 07/19/2021
5.0.1 209 01/27/2021
5.0.0 214 01/26/2021
5.0.0-rc.2.20475.5 59 07/09/2023
5.0.0-rc.1.20451.14 64 07/08/2023
5.0.0-preview.8.20407.11 70 10/14/2022
5.0.0-preview.7.20364.11 59 07/01/2023
5.0.0-preview.6.20305.6 73 04/19/2023
5.0.0-preview.5.20278.1 69 05/05/2023
5.0.0-preview.4.20251.6 62 05/23/2023
5.0.0-preview.3.20215.2 70 07/03/2022
5.0.0-preview.2.20160.3 56 07/08/2023
5.0.0-preview.1.20120.4 57 05/18/2023
3.1.32 59 05/16/2023
3.1.31 50 04/07/2023
3.1.30 67 03/21/2023
3.1.29 53 01/21/2023
3.1.28 55 12/19/2022
3.1.27 58 09/22/2022
3.1.26 58 07/22/2022
3.1.25 51 05/12/2023
3.1.24 54 04/01/2023
3.1.23 54 07/05/2023
3.1.22 56 07/05/2023
3.1.21 50 11/05/2022
3.1.20 61 05/19/2023
3.1.19 66 06/20/2022
3.1.18 59 09/05/2022
3.1.17 65 03/17/2023
3.1.16 53 05/04/2023
3.1.15 47 04/04/2023
3.1.14 51 02/26/2023
3.1.13 52 11/05/2022
3.1.12 62 09/18/2022
3.1.11 58 02/02/2023
3.1.10 60 03/10/2023
3.1.9 59 12/18/2022
3.1.8 52 04/01/2023
3.1.7 60 11/10/2020
3.1.6 57 04/02/2023
3.1.5 78 10/04/2022
3.1.4 5,884 07/19/2021
3.1.3 61 03/29/2023
3.1.2 66 06/11/2022
3.1.1 57 07/25/2022
3.1.0 539 02/02/2021
3.1.0-preview3.19553.2 64 06/07/2022
3.1.0-preview2.19525.4 54 12/03/2022
3.1.0-preview1.19506.1 69 10/30/2022
3.0.3 58 09/28/2022
3.0.2 47 02/12/2023
3.0.1 57 12/29/2022
3.0.0 60 04/17/2023
3.0.0-rc1.19456.10 70 07/07/2023
3.0.0-preview9.19423.4 70 07/10/2023
3.0.0-preview8.19405.4 73 10/06/2022
3.0.0-preview7.19362.4 57 04/10/2023
3.0.0-preview6.19304.6 62 03/16/2023
3.0.0-preview5.19227.9 48 07/10/2023
3.0.0-preview4.19216.2 64 03/02/2023
3.0.0-preview3.19153.1 57 07/09/2023
3.0.0-preview.19074.2 51 07/17/2022
3.0.0-preview.18572.1 52 11/04/2022
2.2.0 59 07/12/2022
2.2.0-preview3-35497 63 09/04/2022
2.2.0-preview2-35157 57 05/24/2023
2.2.0-preview1-35029 63 02/01/2023
2.1.1 103 11/09/2020
2.1.0 90 11/01/2020
2.1.0-rc1-final 68 07/11/2023
2.1.0-preview2-final 76 11/19/2022
2.1.0-preview1-final 63 04/29/2023
2.0.0 59 06/07/2022
2.0.0-preview2-final 61 05/04/2023
2.0.0-preview1-final 53 07/01/2023
1.1.1 63 12/29/2022
1.1.0 52 03/02/2023
1.1.0-preview1-final 51 03/17/2023
1.0.2 55 03/18/2023
1.0.1 57 10/02/2022
1.0.0 55 09/01/2022
1.0.0-rc2-final 54 09/07/2022
1.0.0-rc1-final 65 03/19/2023