Microsoft.Extensions.DependencyInjection 9.0.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
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
136
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
120
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
118
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
117
Microsoft.AspNetCore.Components.Web
Support for rendering ASP.NET Core components for browsers. This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/af22effae4069a5dfb9b0735859de48820104f5b
115
Microsoft.AspNetCore.Components.Web
Support for rendering ASP.NET Core components for browsers. This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/432e6a061f28dda696ba16bc5442328d23b25d93
115
Microsoft.AspNetCore.Components.Web
Support for rendering ASP.NET Core components for browsers. This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/3f1acb59718cadf111a0a796681e3d3509bb3381
115
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
113
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
19
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
3
Microsoft.VisualStudio.Web.CodeGeneration.Design
Code Generation tool for ASP.NET Core. Contains the dotnet-aspnet-codegenerator command used for generating controllers and views.
2
Microsoft.VisualStudio.Web.CodeGenerators.Mvc
Code Generators for ASP.NET Core MVC. Contains code generators for MVC Controllers and Views.
2
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
2
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
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
2
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
1
Microsoft.AspNetCore.All
Microsoft.AspNetCore.All
1
Microsoft.AspNetCore.Components.Web
Support for rendering ASP.NET Core components for browsers. This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/25ef4aa38b77974263cb10f6e9cbd10135f17b59
1
Microsoft.AspNetCore.Components.Web
Support for rendering ASP.NET Core components for browsers. This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/3c37ef8f5358abb303c05d299f029fca7d867d56
1
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
1

Version Downloads Last updated
9.0.9 18 12/20/2025
9.0.8 124 12/20/2025
9.0.4 119 12/19/2025
9.0.0 137 12/19/2025
9.0.0-rc.2.24473.5 2 12/20/2025
9.0.0-rc.1.24431.7 1 12/19/2025
8.0.0-rc.2.23479.6 1 12/19/2025
7.0.0 1 12/19/2025
6.0.0 114 12/21/2025
6.0.0-rc.2.21480.5 1 12/19/2025
6.0.0-preview.1.21102.12 0 12/20/2025
5.0.0-preview.7.20364.11 1 12/19/2025
3.1.31 1 12/20/2025
3.1.30 1 01/02/2026
3.1.24 1 12/20/2025
3.1.1 1 12/20/2025