Asp.net core webapi applicationInitialization recurring jobs

Tags: #<Tag:0x00007efd27716620> #<Tag:0x00007efd27715568> #<Tag:0x00007efd277256e8>

Hi everyone,

I have an asp.net core webapi with hangfire to do some recurring jobs.

I’m struggling on how to run the recurring jobs after the IIS is restarted.

I am on a IIS 8.5

  • IIS Feature App Initialization is installed
  • alwaysRunning (in AppPool) and preloadEnabled (site) are both true
  • I’ve added in the web.config the <system.webServer> part which has an initializationPage="/controller/action" element.

Still when restarting the IIS, I need to manually open a URL from this webapi so everything is up and running.

Does anyone have additional suggestions what am I missing?

I’ve looked up the documentation making-aspnet-app-always-running but this I guess does not work for asp.net core webapi because there is no “System.Web.Hosting.IProcessHostPreloadClient” namespace.

Any hints are warmly welcome!

The web application can be initialized by the assistance of dell error code 2000-0147 and you can also get technical assistance as well.

I face the same problem?? @rogatec are you solved it?

Hi :wave:t3: @Hesham_Gomaa,
Unfortunately I didn’t solve the problem and switched to the default .Net Core Background Task handling. I now don’t have any web ui for monitoring but have everything implemented with standard libraries and restarting a iis is no problem at all.

This will help you get started: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services
Additionally I found some blog where a guy implemented a cronjob like classes, which I am now also using.

Regards, Rogaa

1 Like