The BackgroundService
in Asp.Net Core 3.1 do not automatically start after I start / restart IIS. It needs manual http request call (browse from browser) to start.
Is there anything / any IIS configuration I am missing here?
The BackgroundService
in Asp.Net Core 3.1 do not automatically start after I start / restart IIS. It needs manual http request call (browse from browser) to start.
Is there anything / any IIS configuration I am missing here?
It depends your implementation, did you write backgroundService start call in your startup? Personally I always write background service as a service never host them in IIS.
Cause don't know how is your design but this is expecting behavior of IIS. When you start the IIS it's actually starts to listen that port for http request and call your application's startup function. After the first http request coming through that site it's sending it to the application with new thread (this T time where your application truly run http flow).
Also background workers are not good for IIS, this answer explaining clearly.
Code snip will be more helpfull.