Microsoft.Extensions.DependencyInjection 10.0.0-preview.2.25163.2

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
Microsoft.AspNetCore.Mvc
ASP.NET Core MVC is a web framework that gives you a powerful, patterns-based way to build dynamic websites and web APIs. ASP.NET Core MVC enables a clean separation of concerns and gives you full control over markup.
585
Microsoft.AspNetCore.Mvc.Localization
ASP.NET Core MVC features that enable globalization and localization of applications. Commonly used types: Microsoft.AspNetCore.Mvc.Localization.IHtmlLocalizer<TResource> Microsoft.AspNetCore.Mvc.Localization.IViewLocalizer
566
Microsoft.EntityFrameworkCore
Entity Framework Core is a lightweight and extensible version of the popular Entity Framework data access technology. Commonly Used Types: Microsoft.EntityFrameworkCore.DbContext Microsoft.EntityFrameworkCore.DbSet
483
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
1,028
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
1,253
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
2,062
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications. When using NuGet 3.x this package requires at least version 3.4.
261
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
326
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
174
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
197
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
215
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
399
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
415
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
452
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
464
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
478
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
487
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
549
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
573
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging. When using NuGet 3.x this package requires at least version 3.4.
2,282

.NET Framework 4.6.2

.NET 8.0

.NET 9.0

.NET 10.0

.NET Standard 2.0

.NET Standard 2.1

Version Downloads Last updated
10.0.2 0 01/13/2026
10.0.1 1 12/15/2025
10.0.0 2 11/25/2025
10.0.0-rc.2.25502.107 3 10/27/2025
10.0.0-rc.1.25451.107 4 09/14/2025
10.0.0-preview.7.25380.108 5 08/21/2025
10.0.0-preview.6.25358.103 7 07/19/2025
10.0.0-preview.5.25277.114 8 06/19/2025
10.0.0-preview.4.25258.110 4 08/07/2025
10.0.0-preview.3.25171.5 5 08/07/2025
10.0.0-preview.2.25163.2 5 08/07/2025
10.0.0-preview.1.25080.5 5 08/07/2025
9.0.12 0 01/13/2026
9.0.11 196 12/28/2025
9.0.10 170 10/16/2025
9.0.9 232 09/09/2025
9.0.8 127 08/12/2025
9.0.7 209 07/09/2025
9.0.6 5 08/04/2025
9.0.5 5 08/04/2025
9.0.4 412 04/28/2025
9.0.3 5 08/04/2025
9.0.2 42 02/27/2025
9.0.1 80 01/16/2025
9.0.0 24 11/22/2024
9.0.0-rc.2.24473.5 54 05/01/2025
9.0.0-rc.1.24431.7 4 08/06/2025
9.0.0-preview.7.24405.7 4 09/16/2025
9.0.0-preview.6.24327.7 5 08/09/2025
9.0.0-preview.5.24306.7 5 08/09/2025
9.0.0-preview.4.24266.19 4 09/16/2025
9.0.0-preview.3.24172.9 4 09/16/2025
9.0.0-preview.2.24128.5 6 06/19/2025
9.0.0-preview.1.24080.9 5 08/08/2025
8.0.1 558 01/04/2025
8.0.0 76 10/28/2024
8.0.0-rc.2.23479.6 5 08/06/2025
8.0.0-rc.1.23419.4 4 08/06/2025
8.0.0-preview.7.23375.6 4 09/16/2025
8.0.0-preview.6.23329.7 4 09/16/2025
8.0.0-preview.5.23280.8 5 08/08/2025
8.0.0-preview.4.23259.5 3 09/16/2025
8.0.0-preview.3.23174.8 4 09/16/2025
8.0.0-preview.2.23128.3 4 09/15/2025
8.0.0-preview.1.23110.8 5 08/08/2025
7.0.0 4 04/25/2025
7.0.0-rc.2.22472.3 5 08/06/2025
7.0.0-rc.1.22426.10 5 08/06/2025
7.0.0-preview.7.22375.6 5 08/08/2025
7.0.0-preview.6.22324.4 5 08/08/2025
7.0.0-preview.5.22301.12 4 08/09/2025
7.0.0-preview.4.22229.4 6 07/03/2025
7.0.0-preview.3.22175.4 4 08/09/2025
7.0.0-preview.2.22152.2 5 08/08/2025
7.0.0-preview.1.22076.8 4 09/16/2025
6.0.2 7 04/25/2025
6.0.1 5 08/04/2025
6.0.0 29 04/25/2025
6.0.0-rc.2.21480.5 5 08/06/2025
6.0.0-rc.1.21451.13 4 08/06/2025
6.0.0-preview.7.21377.19 5 08/09/2025
6.0.0-preview.6.21352.12 4 08/09/2025
6.0.0-preview.5.21301.5 5 08/08/2025
6.0.0-preview.4.21253.7 5 08/09/2025
6.0.0-preview.3.21201.4 6 06/19/2025
6.0.0-preview.2.21154.6 4 09/16/2025
6.0.0-preview.1.21102.12 4 08/09/2025
5.0.2 2,238 08/11/2021
5.0.1 1,207 02/26/2021
5.0.0 2,311 03/01/2021
5.0.0-rc.2.20475.5 5 08/06/2025
5.0.0-rc.1.20451.14 5 08/06/2025
5.0.0-preview.8.20407.11 5 08/09/2025
5.0.0-preview.7.20364.11 3 08/10/2025
5.0.0-preview.6.20305.6 5 08/08/2025
5.0.0-preview.5.20278.1 3 10/28/2025
5.0.0-preview.4.20251.6 4 09/16/2025
5.0.0-preview.3.20215.2 5 08/08/2025
5.0.0-preview.2.20160.3 6 08/08/2025
5.0.0-preview.1.20120.4 5 07/03/2025
3.1.32 458 08/22/2024
3.1.31 5 08/06/2025
3.1.30 5 07/03/2025
3.1.29 5 08/06/2025
3.1.28 5 08/06/2025
3.1.27 5 08/06/2025
3.1.26 5 08/06/2025
3.1.25 5 08/06/2025
3.1.24 6 07/23/2025
3.1.23 5 08/06/2025
3.1.22 5 08/06/2025
3.1.21 5 08/06/2025
3.1.20 5 08/06/2025
3.1.19 5 08/06/2025
3.1.18 5 08/06/2025
3.1.17 5 08/06/2025
3.1.16 6 06/19/2025
3.1.15 11 05/12/2021
3.1.14 16 04/07/2021
3.1.13 153 03/11/2021
3.1.12 5 08/06/2025
3.1.11 5 08/06/2025
3.1.10 10 03/01/2021
3.1.9 5 08/04/2025
3.1.8 4 08/04/2025
3.1.7 6 07/03/2025
3.1.6 5 08/04/2025
3.1.5 5 08/04/2025
3.1.4 5 08/04/2025
3.1.3 5 08/04/2025
3.1.2 5 08/04/2025
3.1.1 5 08/04/2025
3.1.0 543 03/01/2021
3.1.0-preview3.19553.2 5 08/08/2025
3.1.0-preview2.19525.4 4 08/09/2025
3.1.0-preview1.19506.1 5 08/08/2025
3.0.3 5 08/04/2025
3.0.2 5 08/04/2025
3.0.1 6 08/01/2025
3.0.0 88 03/01/2021
3.0.0-rc1.19456.10 5 08/09/2025
3.0.0-preview9.19423.4 5 08/09/2025
3.0.0-preview8.19405.4 5 08/09/2025
3.0.0-preview7.19362.4 3 08/09/2025
3.0.0-preview6.19304.6 6 07/18/2025
3.0.0-preview5.19227.9 4 08/09/2025
3.0.0-preview4.19216.2 5 08/09/2025
3.0.0-preview3.19153.1 5 08/08/2025
3.0.0-preview.19074.2 3 08/09/2025
3.0.0-preview.18572.1 4 08/09/2025
2.2.0 32 09/25/2024
2.2.0-preview3-35497 4 08/09/2025
2.2.0-preview2-35157 4 08/09/2025
2.2.0-preview1-35029 5 08/09/2025
2.1.1 4 08/04/2025
2.1.0 146 08/22/2024
2.1.0-rc1-final 6 08/06/2025
2.1.0-preview2-final 4 08/06/2025
2.1.0-preview1-final 5 08/06/2025
2.0.0 9 04/25/2025
2.0.0-preview2-final 5 08/06/2025
2.0.0-preview1-final 6 07/03/2025
1.1.1 5 08/04/2025
1.1.0 5 08/04/2025
1.1.0-preview1-final 5 08/06/2025
1.0.2 5 08/04/2025
1.0.1 4 08/04/2025
1.0.0 5 08/04/2025
1.0.0-rc2-final 5 08/06/2025
1.0.0-rc1-final 3 09/14/2025