Microsoft.Extensions.DependencyInjection 9.0.0-preview.1.24080.9

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,744
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
5,320
HotChocolate.Execution
Package Description
5,280
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,277
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
5,072
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
2,584
Cocona
Micro-framework for .NET console application. Cocona makes it easy and fast to build console applications on .NET.
2,581
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
2,574
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
2,551
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
2,053
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
1,188
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
957
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
524
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
519
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
517
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
515
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
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
509
HotChocolate.Execution
Package Description
496
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
302

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

.NET Framework 4.6.2

.NET 8.0

.NET 9.0

.NET Standard 2.0

.NET Standard 2.1

Version Downloads Last updated
10.0.0-rc.2.25502.107 4 10/16/2025
10.0.0-rc.1.25451.107 10 09/11/2025
10.0.0-preview.7.25380.108 10 08/15/2025
10.0.0-preview.6.25358.103 12 07/16/2025
10.0.0-preview.5.25277.114 19 06/09/2025
10.0.0-preview.4.25258.110 22 05/15/2025
10.0.0-preview.3.25171.5 26 04/12/2025
10.0.0-preview.2.25163.2 24 03/23/2025
10.0.0-preview.1.25080.5 28 02/26/2025
9.0.10 3 10/16/2025
9.0.9 5 09/11/2025
9.0.8 419 08/07/2025
9.0.7 955 07/10/2025
9.0.6 1,188 06/14/2025
9.0.5 20 05/16/2025
9.0.4 23 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,051 11/13/2024
9.0.0-rc.2.24473.5 35 10/17/2024
9.0.0-rc.1.24431.7 36 09/12/2024
9.0.0-preview.7.24405.7 41 08/15/2024
9.0.0-preview.6.24327.7 51 07/11/2024
9.0.0-preview.5.24306.7 45 06/14/2024
9.0.0-preview.4.24266.19 39 06/05/2024
9.0.0-preview.3.24172.9 47 04/13/2024
9.0.0-preview.2.24128.5 54 03/19/2024
9.0.0-preview.1.24080.9 57 02/16/2024
8.0.1 34 10/09/2024
8.0.0 5,327 11/17/2023
8.0.0-rc.2.23479.6 56 10/23/2023
8.0.0-rc.1.23419.4 65 09/14/2023
8.0.0-preview.7.23375.6 51 08/17/2023
8.0.0-preview.6.23329.7 50 07/21/2023
8.0.0-preview.5.23280.8 45 07/16/2023
8.0.0-preview.4.23259.5 62 05/29/2023
8.0.0-preview.3.23174.8 56 04/29/2023
8.0.0-preview.2.23128.3 509 07/04/2023
8.0.0-preview.1.23110.8 68 02/26/2023
7.0.0 524 11/15/2022
7.0.0-rc.2.22472.3 56 07/09/2023
7.0.0-rc.1.22426.10 62 11/30/2022
7.0.0-preview.7.22375.6 70 08/10/2022
7.0.0-preview.6.22324.4 75 05/19/2023
7.0.0-preview.5.22301.12 65 05/03/2023
7.0.0-preview.4.22229.4 54 07/03/2023
7.0.0-preview.3.22175.4 58 09/29/2022
7.0.0-preview.2.22152.2 61 09/28/2022
7.0.0-preview.1.22076.8 60 03/25/2023
6.0.2 36 11/13/2024
6.0.2-mauipre.1.22102.15 56 07/09/2022
6.0.2-mauipre.1.22054.8 60 03/26/2023
6.0.1 63 01/24/2023
6.0.0 2,588 11/09/2021
6.0.0-rc.2.21480.5 56 07/09/2023
6.0.0-rc.1.21451.13 53 05/04/2023
6.0.0-preview.7.21377.19 49 07/03/2023
6.0.0-preview.6.21352.12 53 07/11/2023
6.0.0-preview.5.21301.5 48 05/10/2023
6.0.0-preview.4.21253.7 68 11/22/2022
6.0.0-preview.3.21201.4 59 07/10/2023
6.0.0-preview.2.21154.6 50 07/12/2023
6.0.0-preview.1.21102.12 67 07/09/2023
5.0.2 70 07/19/2021
5.0.1 209 01/27/2021
5.0.0 210 01/26/2021
5.0.0-rc.2.20475.5 56 07/09/2023
5.0.0-rc.1.20451.14 64 07/08/2023
5.0.0-preview.8.20407.11 65 10/14/2022
5.0.0-preview.7.20364.11 54 07/01/2023
5.0.0-preview.6.20305.6 68 04/19/2023
5.0.0-preview.5.20278.1 66 05/05/2023
5.0.0-preview.4.20251.6 62 05/23/2023
5.0.0-preview.3.20215.2 68 07/03/2022
5.0.0-preview.2.20160.3 53 07/08/2023
5.0.0-preview.1.20120.4 55 05/18/2023
3.1.32 58 05/16/2023
3.1.31 48 04/07/2023
3.1.30 64 03/21/2023
3.1.29 52 01/21/2023
3.1.28 54 12/19/2022
3.1.27 55 09/22/2022
3.1.26 58 07/22/2022
3.1.25 50 05/12/2023
3.1.24 52 04/01/2023
3.1.23 53 07/05/2023
3.1.22 53 07/05/2023
3.1.21 49 11/05/2022
3.1.20 61 05/19/2023
3.1.19 60 06/20/2022
3.1.18 58 09/05/2022
3.1.17 61 03/17/2023
3.1.16 49 05/04/2023
3.1.15 44 04/04/2023
3.1.14 51 02/26/2023
3.1.13 51 11/05/2022
3.1.12 60 09/18/2022
3.1.11 56 02/02/2023
3.1.10 57 03/10/2023
3.1.9 57 12/18/2022
3.1.8 49 04/01/2023
3.1.7 59 11/10/2020
3.1.6 54 04/02/2023
3.1.5 73 10/04/2022
3.1.4 5,768 07/19/2021
3.1.3 57 03/29/2023
3.1.2 63 06/11/2022
3.1.1 57 07/25/2022
3.1.0 534 02/02/2021
3.1.0-preview3.19553.2 64 06/07/2022
3.1.0-preview2.19525.4 52 12/03/2022
3.1.0-preview1.19506.1 66 10/30/2022
3.0.3 57 09/28/2022
3.0.2 47 02/12/2023
3.0.1 56 12/29/2022
3.0.0 59 04/17/2023
3.0.0-rc1.19456.10 68 07/07/2023
3.0.0-preview9.19423.4 68 07/10/2023
3.0.0-preview8.19405.4 70 10/06/2022
3.0.0-preview7.19362.4 54 04/10/2023
3.0.0-preview6.19304.6 61 03/16/2023
3.0.0-preview5.19227.9 46 07/10/2023
3.0.0-preview4.19216.2 62 03/02/2023
3.0.0-preview3.19153.1 56 07/09/2023
3.0.0-preview.19074.2 50 07/17/2022
3.0.0-preview.18572.1 50 11/04/2022
2.2.0 57 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 60 02/01/2023
2.1.1 101 11/09/2020
2.1.0 89 11/01/2020
2.1.0-rc1-final 67 07/11/2023
2.1.0-preview2-final 74 11/19/2022
2.1.0-preview1-final 60 04/29/2023
2.0.0 58 06/07/2022
2.0.0-preview2-final 60 05/04/2023
2.0.0-preview1-final 51 07/01/2023
1.1.1 60 12/29/2022
1.1.0 50 03/02/2023
1.1.0-preview1-final 51 03/17/2023
1.0.2 53 03/18/2023
1.0.1 54 10/02/2022
1.0.0 54 09/01/2022
1.0.0-rc2-final 53 09/07/2022
1.0.0-rc1-final 62 03/19/2023