Search code examples
asp.net-coreiisfilesystemwatcher

What could cause FileSystemWatcher to only trigger methods when a user connects to the website?


I have a FileSystemWatcher that is supposed to process incomming files (on an IIS server, in ASP.NET Core) and after processing these, move them to another destination.

It works like a charm, but only when there are users connected to the website, I was wondering what causes this kind of behaviour.

Extra info: When a file pops up in the directory it is listening to and there is no user connected to the website, the code that is defined in the Watcher_Created() method is not executed, and when processing multiple files, upon disctonnection the other files are no longer beeing processed.

Kind regards


Solution

  • Solution found here:

    I hope it helps others.

    https://thycotic.force.com/support/s/article/Changing-IIS-to-not-stop-worker-process-in-IIS-7-and-8