Skip to main content
net10.0net11.0.NETFramework4.6.2.NETStandard2.0.NETStandard2.1

Default implementation of dependency injection for Microsoft.Extensions.DependencyInjection.

Published
Oct 13, 2026
5d ago
Total Downloads
8.0B
8,006,766,664

Install

dotnet add package Microsoft.Extensions.DependencyInjection --version 11.0.0-rc.2.26504.105
ProductVersions
.NET
net10.0net11.0
.NET Standard
netstandard2.0netstandard2.1
Other
.NETFramework4.6.2

README

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

Related Packages

  • 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.

Changes from Previous Version

No structural changes between v11.0.0-rc.1.26425.128 and v11.0.0-rc.2.26504.105.

Adoption Assessment

Most ASP.NET Core and worker services that prioritize low ceremony and first-party integration.

Dependency Injection Guide
This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 5 target frameworks; confirm the exact target used by your application.
Editorial Note: Built-in DI container abstractions and implementation used by the default .NET hosting model. Trade-off: Advanced container features are intentionally minimal compared with full-featured third-party containers.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.