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
Both, WebApplicationBuilderExtensions and WebHostBuilderExtensions, would need these overloads.
Motivation
The current implementation requires the callback task to be ready before the app is instantiated, i.e., before the service collection is initialized. This can cause issues, especially when the callback comes from a service. For that, it would be great to have an overload that allows access to the IServiceCollection, similarly to how the service collection factory pattern works. This allows the normal dependency injection logic to fully resolve the required services on demand, rather than having it initialized beforehand. Furthermore, having access to the arguments at that stage rather than having to pipe them through yourself would also reduce friction.
From what I can tell, the internal ElectronNetRuntime.OnAppReadyCallback is not executed before the app is instantiated which means, the fully initialized service collection would be available at that time.
On a side-note: the argument array has to be provided on the initial UseElectron method, but is never actually used?
Activity
FlorianRappl commentedon Jun 19, 2026
Sounds good - for me this is something that needs to be community contributed.
AeonSake commentedon Jun 19, 2026
I created a PR for this feature. I had to replace the previously used static property due to the late binding required by the service provider.