Microsoft.Extensions.DependencyInjection 8.0.1

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.
6,270
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
4,274
Microsoft.AspNetCore.SignalR.Client.Core
Client for ASP.NET Core SignalR This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/88ec3bc3f37e76fbcc932a25f9f0c1c29fe2b343
3,238
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
3,231
Salazki.Search
Package Description
2,526
Microsoft.AspNetCore.Mvc.Core
ASP.NET Core MVC core components. Contains common action result types, attribute routing, application model conventions, API explorer, application parts, filters, formatters, model binding, and more. Commonly used types: Microsoft.AspNetCore.Mvc.AreaAttribute Microsoft.AspNetCore.Mvc.BindAttribute Microsoft.AspNetCore.Mvc.ControllerBase Microsoft.AspNetCore.Mvc.FromBodyAttribute Microsoft.AspNetCore.Mvc.FromFormAttribute Microsoft.AspNetCore.Mvc.RequireHttpsAttribute Microsoft.AspNetCore.Mvc.RouteAttribute This package was built from the source code at https://github.com/aspnet/Mvc/tree/a6199bbfbab05583f987bae322fb04566841aaea
2,425
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/da7e9894ce22ef8cc02e5acc56e95a6f8cf8f644
2,103
Microsoft.VisualStudio.Web.CodeGeneration.Core
Contains the core infrastructure used by ASP.NET Core Code Generators.
2,010
Microsoft.VisualStudio.Web.CodeGeneration
Contains the CodeGenCommand that finds the appropriate code generator and invokes it from project dependencies.
1,994
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
1,441
Solo.Toolbox
Package Description
1,010
Solo.Beacon
Reusable ASP.NET Core health, discovery, and stats endpoints package for ft-soft solutions.
808
Solo.Renderer
Package Description
571
Solo.Toolbox
Package Description
566
Solo.Tracer.Server
Серверный пакет для трассировки и логирования клиентских данных у входящих запросов.
486
Solo.Renderer
Package Description
472
Salazki2.Presentation
Package Description
430
Solo.Toolbox
Package Description
382
Solo.Tracer.Server
Серверный пакет для трассировки и логирования клиентских данных у входящих запросов.
330
Salazki2.Presentation
Package Description
304

Version Downloads Last updated
8.0.1 3,648 05/09/2025
8.0.0 5,050 05/09/2025
2.2.0 2,371 05/09/2025