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,860
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
5,528
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,394
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
5,279
Cocona
Micro-framework for .NET console application. Cocona makes it easy and fast to build console applications on .NET.
2,767
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
2,763
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
2,753
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
2,724
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
2,259
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
1,393
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
1,162
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
518
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
514
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
510
HotChocolate.Execution
Package Description
496
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
304

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 1 11/12/2025
10.0.0-rc.2.25502.107 5 10/16/2025
10.0.0-rc.1.25451.107 10 09/11/2025
10.0.0-preview.7.25380.108 11 08/15/2025
10.0.0-preview.6.25358.103 14 07/16/2025
10.0.0-preview.5.25277.114 20 06/09/2025
10.0.0-preview.4.25258.110 24 05/15/2025
10.0.0-preview.3.25171.5 26 04/12/2025
10.0.0-preview.2.25163.2 25 03/23/2025
10.0.0-preview.1.25080.5 28 02/26/2025
9.0.11 1 11/13/2025
9.0.10 5 10/16/2025
9.0.9 6 09/11/2025
9.0.8 627 08/07/2025
9.0.7 1,162 07/10/2025
9.0.6 1,398 06/14/2025
9.0.5 23 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,260 11/13/2024
9.0.0-rc.2.24473.5 36 10/17/2024
9.0.0-rc.1.24431.7 37 09/12/2024
9.0.0-preview.7.24405.7 43 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 41 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 58 02/16/2024
8.0.1 34 10/09/2024
8.0.0 5,533 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 52 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 510 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 59 07/09/2023
7.0.0-rc.1.22426.10 62 11/30/2022
7.0.0-preview.7.22375.6 71 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 55 07/03/2023
7.0.0-preview.3.22175.4 59 09/29/2022
7.0.0-preview.2.22152.2 62 09/28/2022
7.0.0-preview.1.22076.8 63 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 60 03/26/2023
6.0.1 63 01/24/2023
6.0.0 2,765 11/09/2021
6.0.0-rc.2.21480.5 56 07/09/2023
6.0.0-rc.1.21451.13 54 05/04/2023
6.0.0-preview.7.21377.19 50 07/03/2023
6.0.0-preview.6.21352.12 53 07/11/2023
6.0.0-preview.5.21301.5 49 05/10/2023
6.0.0-preview.4.21253.7 69 11/22/2022
6.0.0-preview.3.21201.4 60 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 70 07/19/2021
5.0.1 209 01/27/2021
5.0.0 211 01/26/2021
5.0.0-rc.2.20475.5 57 07/09/2023
5.0.0-rc.1.20451.14 64 07/08/2023
5.0.0-preview.8.20407.11 67 10/14/2022
5.0.0-preview.7.20364.11 57 07/01/2023
5.0.0-preview.6.20305.6 71 04/19/2023
5.0.0-preview.5.20278.1 67 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 54 07/08/2023
5.0.0-preview.1.20120.4 56 05/18/2023
3.1.32 59 05/16/2023
3.1.31 49 04/07/2023
3.1.30 66 03/21/2023
3.1.29 52 01/21/2023
3.1.28 54 12/19/2022
3.1.27 57 09/22/2022
3.1.26 58 07/22/2022
3.1.25 51 05/12/2023
3.1.24 52 04/01/2023
3.1.23 53 07/05/2023
3.1.22 55 07/05/2023
3.1.21 49 11/05/2022
3.1.20 61 05/19/2023
3.1.19 63 06/20/2022
3.1.18 59 09/05/2022
3.1.17 62 03/17/2023
3.1.16 51 05/04/2023
3.1.15 46 04/04/2023
3.1.14 51 02/26/2023
3.1.13 52 11/05/2022
3.1.12 61 09/18/2022
3.1.11 56 02/02/2023
3.1.10 58 03/10/2023
3.1.9 59 12/18/2022
3.1.8 49 04/01/2023
3.1.7 60 11/10/2020
3.1.6 56 04/02/2023
3.1.5 75 10/04/2022
3.1.4 5,884 07/19/2021
3.1.3 59 03/29/2023
3.1.2 63 06/11/2022
3.1.1 57 07/25/2022
3.1.0 535 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 68 10/30/2022
3.0.3 58 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 70 07/07/2023
3.0.0-preview9.19423.4 68 07/10/2023
3.0.0-preview8.19405.4 72 10/06/2022
3.0.0-preview7.19362.4 55 04/10/2023
3.0.0-preview6.19304.6 62 03/16/2023
3.0.0-preview5.19227.9 47 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 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 62 02/01/2023
2.1.1 101 11/09/2020
2.1.0 90 11/01/2020
2.1.0-rc1-final 68 07/11/2023
2.1.0-preview2-final 75 11/19/2022
2.1.0-preview1-final 60 04/29/2023
2.0.0 58 06/07/2022
2.0.0-preview2-final 61 05/04/2023
2.0.0-preview1-final 52 07/01/2023
1.1.1 62 12/29/2022
1.1.0 51 03/02/2023
1.1.0-preview1-final 51 03/17/2023
1.0.2 54 03/18/2023
1.0.1 54 10/02/2022
1.0.0 55 09/01/2022
1.0.0-rc2-final 53 09/07/2022
1.0.0-rc1-final 64 03/19/2023