How to resolve service registered in IServiceCollection?
See original GitHub issueWhen using ASP.NET Core and registering services in IServiceCollection
from Startup.ConfigureServices
method, those services then are not available in IResolverContext
when I use T Service<T>()
.
Is this by design or a bug?
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (10 by maintainers)
Top Results From Across the Web
Resolving instances with ASP.NET Core DI from within ...
The IServiceCollection interface is used for building a dependency injection container. After it's fully built, it gets composed to an ...
Read more >Resolve Services In ASP.NET Core Startup
Several approaches to resolve registered services within the Startup class of your ASP.NET Core application.
Read more >Dependency injection in ASP.NET Core
Inject the service into the middleware's Invoke or InvokeAsync method. Using constructor injection throws a runtime exception because it forces ...
Read more >How to manually resolve a service registered in ...
If I register a service like so: builder.Services.AddSingleton<IMyRepository, MyRepository>();. How do I manually resolve that within another ...
Read more >How to resolve dependencies in ASP.NET Core
Resolve dependencies using IServiceProvider ... You can use the IServiceCollection interface to create a dependency injection container. Once the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
On fresh project it works as expected. I will add more code to it in order to replicate setup.
Working on it