NetCore 3.x getting Container at ConfigureServices
See original GitHub issueHi @ltines
in the help net-dependency-extension it states: “Alternatively you can create ConfigureServices method in Startup class that gets passed the IWindsorContainer” What do you mean by this. If i:
public void ConfigureServices(IServiceCollection services, IWindsorContainer container)
{
services.AddControllers();
}
I get an exception: “The ConfigureServices method must either be parameterless or take only one parameter of type IServiceCollection.”
And the “ConfigureContainer” is called after “ConfigureServices”
Is there any way we can control the container? I.e. so e.g. we pass the container into UseWindsorContainerServiceProvider(), e.g.:
Host.CreateDefaultBuilder(args).UseWindsorContainerServiceProvider(contariner)
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
ASP.NET Core 3.x - Access IoC Container
In ASP.NET Core 3.x, the usage of IoC containers like Autofac changed. Instead of returning some adapter instance in ConfigureServices , we have ......
Read more >Dependency injection in ASP.NET Core
The container resolves the dependencies in the graph and returns the fully resolved service. The collective set of dependencies that must be ...
Read more >Avoiding Startup service injection in ASP.NET Core 3
In this post I describe the changes to dependency injection in your Startup class when upgrading an ASP.NET Core 2.x app to .NET...
Read more >Dependency Injection in ASP.NET Core
ASP.NET Core allows us to register our application services with IoC container, in the ConfigureServices method of the Startup class.
Read more >ASP.NET Core — Autofac 7.0.0 documentation
NET Core introduces a conforming container mechanism via Microsoft. ... AutofacContainer { get; private set; } // ConfigureServices is where you register ...
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
@generik0 That’s a typo - it should be
ConfigureContainer(IWindsorContainer container)
Hi again everyone
I have noticed that instead of the UseWindsorContainerServiceProvider is is possible to add the startup base on the Startup with a factory implementation. This might be good to add to md?
Also, gives even more reason to allow substitution of the factory and methods, instead of an extension?