Microsoft.Extensions.DependencyInjection 9.0.0-preview.1.24080.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
dis.taskmanager.contracts
Package Description
4,397
HotChocolate.Execution
Package Description
7,853
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
3,443
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
9,096
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
3,278
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
4,124
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
4,793
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
8,139
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
9,111
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
9,597
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
12,949
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
3,734
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
9,066
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
9,101
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
24,814
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging. When using NuGet 3.x this package requires at least version 3.4.
23,285
Npgsql.EntityFrameworkCore.PostgreSQL
Npgsql.EntityFrameworkCore.PostgreSQL
3,459
Npgsql.EntityFrameworkCore.PostgreSQL.Design
Npgsql.EntityFrameworkCore.PostgreSQL.Design
3,448
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
9,822
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
12,696

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
9.0.0-preview.3.24172.9 1 04/17/2024
9.0.0-preview.2.24128.5 2 03/15/2024
9.0.0-preview.1.24080.9 7 02/19/2024
8.0.0 12 11/16/2023
8.0.0-rc.2.23479.6 5 10/19/2023
8.0.0-rc.1.23419.4 7 09/23/2023
8.0.0-preview.7.23375.6 8 09/09/2023
8.0.0-preview.6.23329.7 9 09/08/2023
8.0.0-preview.5.23280.8 9 06/14/2023
8.0.0-preview.4.23259.5 9 05/19/2023
8.0.0-preview.3.23174.8 7 06/17/2023
8.0.0-preview.2.23128.3 9 04/02/2023
8.0.0-preview.1.23110.8 10 04/02/2023
7.0.0 3,747 11/15/2022
7.0.0-rc.2.22472.3 9 10/15/2022
7.0.0-rc.1.22426.10 9 09/24/2022
7.0.0-preview.7.22375.6 8 10/15/2022
7.0.0-preview.6.22324.4 14 09/27/2022
7.0.0-preview.5.22301.12 10 09/25/2022
7.0.0-preview.4.22229.4 13 09/23/2022
7.0.0-preview.3.22175.4 10 06/17/2023
7.0.0-preview.2.22152.2 9 06/27/2022
7.0.0-preview.1.22076.8 11 06/27/2022
6.0.2-mauipre.1.22102.15 19 07/29/2022
6.0.2-mauipre.1.22054.8 10 06/27/2022
6.0.1 16,773 10/16/2022
6.0.0 20,096 06/27/2022
6.0.0-rc.2.21480.5 12 09/23/2022
6.0.0-rc.1.21451.13 7 06/17/2023
6.0.0-preview.7.21377.19 11 09/22/2022
6.0.0-preview.6.21352.12 10 06/27/2022
6.0.0-preview.5.21301.5 13 09/23/2022
6.0.0-preview.4.21253.7 6 06/27/2022
6.0.0-preview.3.21201.4 11 06/27/2022
6.0.0-preview.2.21154.6 7 09/21/2022
6.0.0-preview.1.21102.12 9 09/25/2022
5.0.2 10,929 06/27/2022
5.0.1 13 06/27/2022
5.0.0 23,299 06/27/2022
5.0.0-rc.2.20475.5 11 06/27/2022
5.0.0-rc.1.20451.14 8 06/27/2022
5.0.0-preview.8.20407.11 11 06/27/2022
5.0.0-preview.7.20364.11 13 06/29/2022
5.0.0-preview.6.20305.6 16 06/27/2022
5.0.0-preview.5.20278.1 11 06/27/2022
5.0.0-preview.4.20251.6 10 05/19/2023
5.0.0-preview.3.20215.2 13 07/05/2022
5.0.0-preview.2.20160.3 10 06/27/2022
5.0.0-preview.1.20120.4 11 09/25/2022
3.1.32 7 01/13/2023
3.1.31 10 01/13/2023
3.1.30 11 04/03/2023
3.1.29 15 09/22/2022
3.1.28 14 09/22/2022
3.1.27 14 09/21/2022
3.1.26 8 09/22/2022
3.1.25 9 09/27/2022
3.1.24 9 06/27/2022
3.1.23 8 06/27/2022
3.1.22 14 06/28/2022
3.1.21 15 09/21/2022
3.1.20 10 06/27/2022
3.1.19 8 09/22/2022
3.1.18 9 03/20/2023
3.1.17 13 06/28/2022
3.1.16 10 06/27/2022
3.1.15 16 07/03/2022
3.1.14 10 09/21/2022
3.1.13 8 06/27/2022
3.1.12 9 06/27/2022
3.1.11 12 06/27/2022
3.1.10 16 07/05/2022
3.1.9 7 02/26/2023
3.1.8 10 06/27/2022
3.1.7 12 09/22/2022
3.1.6 11 07/05/2022
3.1.5 9,093 06/27/2022
3.1.4 2,316 07/05/2022
3.1.3 9,072 06/27/2022
3.1.2 11 06/27/2022
3.1.1 8 09/21/2022
3.1.0 248 09/22/2022
3.1.0-preview3.19553.2 8 07/05/2022
3.1.0-preview2.19525.4 8 09/21/2022
3.1.0-preview1.19506.1 10 07/05/2022
3.0.3 9 06/27/2022
3.0.2 9 06/27/2022
3.0.1 14 07/26/2022
3.0.0 10 09/21/2022
3.0.0-rc1.19456.10 6 06/17/2023
3.0.0-preview9.19423.4 9 06/17/2023
3.0.0-preview8.19405.4 9 07/03/2022
3.0.0-preview7.19362.4 9 07/12/2022
3.0.0-preview6.19304.6 7 09/21/2022
3.0.0-preview5.19227.9 10 07/09/2022
3.0.0-preview4.19216.2 15 07/05/2022
3.0.0-preview3.19153.1 12 07/01/2022
3.0.0-preview.19074.2 11 06/17/2023
3.0.0-preview.18572.1 9 07/05/2022
2.2.0 1,023 09/27/2022
2.2.0-preview3-35497 13 07/25/2022
2.2.0-preview2-35157 9 07/27/2022
2.2.0-preview1-35029 12 06/30/2022
2.1.1 16 06/27/2022
2.1.0 7 06/27/2022
2.1.0-rc1-final 7 09/22/2022
2.1.0-preview2-final 9 07/05/2022
2.1.0-preview1-final 8 07/05/2022
2.0.0 1,190 06/27/2022
2.0.0-preview2-final 7 04/17/2023
2.0.0-preview1-final 6 09/21/2022
1.1.1 23 08/02/2022
1.1.0 3,439 06/27/2022
1.1.0-preview1-final 12 07/02/2022
1.0.2 10 06/30/2022
1.0.1 14 09/21/2022
1.0.0 9 09/27/2022
1.0.0-rc2-final 13 09/21/2022
1.0.0-rc1-final 12 07/05/2022