Using IProcessHostPreloadClient with IoC Container to ensure HangFire and ASP.NET app always running

I followed the advice on docs page below:
http://docs.hangfire.io/en/latest/deployment-to-production/making-aspnet-app-always-running.html#comment-2002936003
(linked to my related comment)

While this will work for setting up the Application_Start and Application_Stop (in global.asax) because I have access to the Container from there, as that is my composition root…

How can i use IoC containers with this interface if my container won’t exist by the time the Preload() fires? My HangFire configuration requires a custom activator and a context scope filter, both of which depend on access the Container:

GlobalConfiguration.Configuration.UseActivator(new SimpleInjectorJobActivator(container));
GlobalJobFilters.Filters.Add(new SimpleInjectorExecutionContextScopeEndFilter(container));
2 Likes

I have same question, did you get answer or solution for it?