I need to run long running background tasks in my asp.net core application.
I know of Azure Webjobs and other out of process techniques but I'd rather keep the solution simple and runs those tasks directly in the asp.net core process.
I use Kestrel and the application is hosted in IIS.
I understand that IIS will occasionally recycle the IIS process. Will it also recycle the asp.net core process?
Best Answer
Asp.Net Core < 2.2
Asp.net Core
runs in a separate processdotnet.exe
even when it is hosted inIIS
. But it doesn't mean that it runs as an independent process.IIS
still responsible forAsp.net core
process (dotnet.exe
) life cycle through theAspNetCoreModule
.So, answer is yes, IIS will also recycle the asp.net core process
Asp.Net Core >= 2.2
Asp.Net Core 2.2 has
in-process
hosting support on IIS in addition toout-of-process
hosting model that was before. It seems it is just an optimization that allows to avoid the additional cost of reverse-proxying requests over to a separate dotnet process. IIS will recycle application pool withAsp.net Core
application