Microsoft.Extensions.DependencyInjection 9.0.0-preview.4.24266.19

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.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
94
Microsoft.VisualStudio.Web.CodeGeneration
Contains the CodeGenCommand that finds the appropriate code generator and invokes it from project dependencies.
78
Microsoft.AspNetCore.App
Provides a default set of APIs for building an ASP.NET Core application. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.
78
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
75
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
69
Swashbuckle.AspNetCore.Filters
Some additional useful filters for Swashbuckle.AspNetCore
66
Microsoft.AspNetCore.App
Provides a default set of APIs for building an ASP.NET Core application. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.
63
Microsoft.AspNetCore.App
Provides a default set of APIs for building an ASP.NET Core application. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.
60
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
60
Microsoft.AspNetCore.App
Microsoft.AspNetCore.App
60
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
58
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications. This package was built from the source code at https://github.com/aspnet/Hosting/tree/0724e6cde1149ee1a19bfec9c13a2c9327b71213
58
Swashbuckle.AspNetCore.Filters
Some additional useful filters for Swashbuckle.AspNetCore. This package replaces Swashbuckle.AspNetCore.Examples.
57
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
57
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
55
Microsoft.VisualStudio.Web.CodeGeneration
Contains the CodeGenCommand that finds the appropriate code generator and invokes it from project dependencies.
54
Microsoft.AspNetCore.App
Provides a default set of APIs for building an ASP.NET Core application. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.
54
Microsoft.AspNetCore.DataProtection.Extensions
Additional APIs for ASP.NET Core data protection. This package was built from the source code at https://github.com/aspnet/AspNetCore/tree/2b7e994b8a304700a09617ffc5052f0d943bbcba
53
Swashbuckle.AspNetCore.Filters
Some additional useful filters for Swashbuckle.AspNetCore
53

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