You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicclassStartup{publicIContainerApplicationContainer{get;privateset;}publicIServiceProviderConfigureServices(IServiceCollectionservices){varbuilder=newContainerBuilder();builder.Populate(services);// Add some custom service and implementation to test whether it can be injectedbuilder.RegisterType<DefaultSystemClock>().As<ISystemClock>();ApplicationContainer=builder.Build();// This return value seems to never be used by the WebAssemblyHostBuilderreturnnewAutofacServiceProvider(ApplicationContainer);}publicvoidConfigure(IBlazorApplicationBuilderapp){app.AddComponent<App>("app");}}
A quick glance into the source of WebAssemblyHostBuilder and ConventionBasedStartup seems to confirm that this is not how it's implemented (there's no code that take care of any return value from the ConfigureServices() method.
Is there some other hook I should be using to replace the default IServiceProvider implementation with the one provided by Autofac?
The text was updated successfully, but these errors were encountered:
I'm trying to hook Autofac into my Blazor app, but I can't find any way to provide the actual
IServiceProvider
instance myself.Here's an illustration of what I'm trying to do (as per Autofac documentation):
A quick glance into the source of
WebAssemblyHostBuilder
andConventionBasedStartup
seems to confirm that this is not how it's implemented (there's no code that take care of any return value from theConfigureServices()
method.Is there some other hook I should be using to replace the default
IServiceProvider
implementation with the one provided by Autofac?The text was updated successfully, but these errors were encountered: