Relative Content

Tag Archive for asp.net-coreiisasp.net-web-apitimeoutdevops

Application shuts down when no requests come in

I have an ASP.NET Core 8.0 C# web application that includes DI container services that are meant to work alongside the main interaction pipeline. Two of them are FileSystemWatchers. One written for relaying images to Tinystash, another for parsing the XML agent upload data and shoving it to the database. These services do not tend to work, due to the fact that IIS kills off the WebHost as soon as no HTTP requests come into the site. The logs (Serilog.Sinks.EventLog) have a following entry: Application is shutting down..., which infers that the site process has been killed. Therefore, the FileSystemWatcher does not have enough time to instantiate and register an event handler. I need to make the web app always online and prevent it from self-disabling. The web app project does not include a Kestrel launch configuration, due to it being directly upgraded from .NET Core 3.1.