Microsoft.Extensions.DependencyInjection (10.0.3)

Published 2026-02-21 13:19:41 +03:30 by kayer

Installation

dotnet nuget add source --name kayer --username your_username --password your_token 
dotnet add package --source kayer --version 10.0.3 Microsoft.Extensions.DependencyInjection

About this package

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

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.

Dependencies

ID Version Target Framework
Microsoft.Bcl.AsyncInterfaces 10.0.3 .NETFramework4.6.2
Microsoft.Extensions.DependencyInjection.Abstractions 10.0.3 .NETFramework4.6.2
System.Threading.Tasks.Extensions 4.6.3 .NETFramework4.6.2
Microsoft.Bcl.AsyncInterfaces 10.0.3 .NETStandard2.0
Microsoft.Extensions.DependencyInjection.Abstractions 10.0.3 .NETStandard2.0
System.Threading.Tasks.Extensions 4.6.3 .NETStandard2.0
Microsoft.Extensions.DependencyInjection.Abstractions 10.0.3 .NETStandard2.1
Microsoft.Extensions.DependencyInjection.Abstractions 10.0.3 net10.0
Microsoft.Extensions.DependencyInjection.Abstractions 10.0.3 net8.0
Microsoft.Extensions.DependencyInjection.Abstractions 10.0.3 net9.0
Details
NuGet
2026-02-21 13:19:41 +03:30
6
Microsoft
345 KiB
Assets (2)
Versions (4) View all
10.0.3 2026-02-21
10.0.0 2026-02-20
9.0.0 2026-02-20
9.0.10 2026-02-04