Getting IConfiguration from ServiceCollection
To get IConfiguration from IServiceCollection why not just resolve the dependency?: IConfiguration configuration = services.BuildServiceProvider().GetService<IConfiguration>();
To get IConfiguration from IServiceCollection why not just resolve the dependency?: IConfiguration configuration = services.BuildServiceProvider().GetService<IConfiguration>();
Microsoft.Extensions.Configuration, like other packages in the Microsoft.Extensions namespace (e.g. Options, or DependencyInjection), are packages that were created as part of the ASP.NET Core framework. The way ASP.NET Core and all its related packages were built however is in a very modular way, so all the libraries can be used within the ASP.NET Core context, or … Read more