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
4,382
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
3,943
HotChocolate.Execution
Package Description
3,927
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.
3,927
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
3,703
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
1,459
Cocona
Micro-framework for .NET console application. Cocona makes it easy and fast to build console applications on .NET.
1,450
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
1,449
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
1,419
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
859
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
507
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
505
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
498
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
497
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
497
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
496
HotChocolate.Execution
Package Description
488
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
287
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
209
HotChocolate.AspNetCore.Authorization
This package contains the ASP.NET Core authorization integrations for Hot Chocolate.
174

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-preview.3.25171.5 10 04/12/2025
10.0.0-preview.2.25163.2 11 03/23/2025
10.0.0-preview.1.25080.5 13 02/26/2025
9.0.4 7 04/13/2025
9.0.3 7 03/15/2025
9.0.2 13 02/16/2025
9.0.1 17 01/19/2025
9.0.0 863 11/13/2024
9.0.0-rc.2.24473.5 19 10/17/2024
9.0.0-rc.1.24431.7 21 09/12/2024
9.0.0-preview.7.24405.7 25 08/15/2024
9.0.0-preview.6.24327.7 32 07/11/2024
9.0.0-preview.5.24306.7 28 06/14/2024
9.0.0-preview.4.24266.19 22 06/05/2024
9.0.0-preview.3.24172.9 29 04/13/2024
9.0.0-preview.2.24128.5 31 03/19/2024
9.0.0-preview.1.24080.9 36 02/16/2024
8.0.1 19 10/09/2024
8.0.0 3,948 11/17/2023
8.0.0-rc.2.23479.6 38 10/23/2023
8.0.0-rc.1.23419.4 44 09/14/2023
8.0.0-preview.7.23375.6 37 08/17/2023
8.0.0-preview.6.23329.7 32 07/21/2023
8.0.0-preview.5.23280.8 28 07/16/2023
8.0.0-preview.4.23259.5 44 05/29/2023
8.0.0-preview.3.23174.8 37 04/29/2023
8.0.0-preview.2.23128.3 494 07/04/2023
8.0.0-preview.1.23110.8 47 02/26/2023
7.0.0 503 11/15/2022
7.0.0-rc.2.22472.3 37 07/09/2023
7.0.0-rc.1.22426.10 47 11/30/2022
7.0.0-preview.7.22375.6 51 08/10/2022
7.0.0-preview.6.22324.4 56 05/19/2023
7.0.0-preview.5.22301.12 46 05/03/2023
7.0.0-preview.4.22229.4 35 07/03/2023
7.0.0-preview.3.22175.4 39 09/29/2022
7.0.0-preview.2.22152.2 41 09/28/2022
7.0.0-preview.1.22076.8 43 03/25/2023
6.0.2 17 11/13/2024
6.0.2-mauipre.1.22102.15 34 07/09/2022
6.0.2-mauipre.1.22054.8 38 03/26/2023
6.0.1 45 01/24/2023
6.0.0 1,460 11/09/2021
6.0.0-rc.2.21480.5 42 07/09/2023
6.0.0-rc.1.21451.13 36 05/04/2023
6.0.0-preview.7.21377.19 30 07/03/2023
6.0.0-preview.6.21352.12 39 07/11/2023
6.0.0-preview.5.21301.5 32 05/10/2023
6.0.0-preview.4.21253.7 48 11/22/2022
6.0.0-preview.3.21201.4 42 07/10/2023
6.0.0-preview.2.21154.6 36 07/12/2023
6.0.0-preview.1.21102.12 46 07/09/2023
5.0.2 50 07/19/2021
5.0.1 188 01/27/2021
5.0.0 190 01/26/2021
5.0.0-rc.2.20475.5 37 07/09/2023
5.0.0-rc.1.20451.14 42 07/08/2023
5.0.0-preview.8.20407.11 45 10/14/2022
5.0.0-preview.7.20364.11 34 07/01/2023
5.0.0-preview.6.20305.6 50 04/19/2023
5.0.0-preview.5.20278.1 46 05/05/2023
5.0.0-preview.4.20251.6 44 05/23/2023
5.0.0-preview.3.20215.2 52 07/03/2022
5.0.0-preview.2.20160.3 34 07/08/2023
5.0.0-preview.1.20120.4 41 05/18/2023
3.1.32 35 05/16/2023
3.1.31 32 04/07/2023
3.1.30 39 03/21/2023
3.1.29 32 01/21/2023
3.1.28 39 12/19/2022
3.1.27 37 09/22/2022
3.1.26 42 07/22/2022
3.1.25 36 05/12/2023
3.1.24 33 04/01/2023
3.1.23 39 07/05/2023
3.1.22 36 07/05/2023
3.1.21 32 11/05/2022
3.1.20 38 05/19/2023
3.1.19 42 06/20/2022
3.1.18 39 09/05/2022
3.1.17 41 03/17/2023
3.1.16 30 05/04/2023
3.1.15 30 04/04/2023
3.1.14 37 02/26/2023
3.1.13 35 11/05/2022
3.1.12 39 09/18/2022
3.1.11 42 02/02/2023
3.1.10 38 03/10/2023
3.1.9 39 12/18/2022
3.1.8 34 04/01/2023
3.1.7 39 11/10/2020
3.1.6 32 04/02/2023
3.1.5 55 10/04/2022
3.1.4 4,398 07/19/2021
3.1.3 37 03/29/2023
3.1.2 46 06/11/2022
3.1.1 36 07/25/2022
3.1.0 514 02/02/2021
3.1.0-preview3.19553.2 45 06/07/2022
3.1.0-preview2.19525.4 38 12/03/2022
3.1.0-preview1.19506.1 49 10/30/2022
3.0.3 36 09/28/2022
3.0.2 34 02/12/2023
3.0.1 37 12/29/2022
3.0.0 41 04/17/2023
3.0.0-rc1.19456.10 50 07/07/2023
3.0.0-preview9.19423.4 48 07/10/2023
3.0.0-preview8.19405.4 50 10/06/2022
3.0.0-preview7.19362.4 38 04/10/2023
3.0.0-preview6.19304.6 45 03/16/2023
3.0.0-preview5.19227.9 31 07/10/2023
3.0.0-preview4.19216.2 43 03/02/2023
3.0.0-preview3.19153.1 39 07/09/2023
3.0.0-preview.19074.2 35 07/17/2022
3.0.0-preview.18572.1 38 11/04/2022
2.2.0 37 07/12/2022
2.2.0-preview3-35497 45 09/04/2022
2.2.0-preview2-35157 42 05/24/2023
2.2.0-preview1-35029 40 02/01/2023
2.1.1 82 11/09/2020
2.1.0 74 11/01/2020
2.1.0-rc1-final 48 07/11/2023
2.1.0-preview2-final 57 11/19/2022
2.1.0-preview1-final 49 04/29/2023
2.0.0 41 06/07/2022
2.0.0-preview2-final 37 05/04/2023
2.0.0-preview1-final 39 07/01/2023
1.1.1 39 12/29/2022
1.1.0 33 03/02/2023
1.1.0-preview1-final 38 03/17/2023
1.0.2 34 03/18/2023
1.0.1 37 10/02/2022
1.0.0 38 09/01/2022
1.0.0-rc2-final 40 09/07/2022
1.0.0-rc1-final 44 03/19/2023