Arin
Arin

Reputation: 652

Starting a new worker process within IIS c#

I have question about a process I start.

I start the process with Process.Start() method. The process is windows form application that has no GUI. I start the process from a web application that runs on it's own application pool (running as LocalSystem) on IIS.

The process starts without problem but after a while I can see in the logs the process stops doing it's job (no logging occurs). If I stop the application pool from which I started the process and start the pool again (doing nothing else) the process starts from where it stopped. I can see this from the logs where it stopped.

I don't have any dependencies to the parent (web app). I am not waiting for anything in the child process. It only does a lot of API calls to another server. The code actually worked flawless when it was running as thread. I changed to a child process because I wanted it to run LONG jobs. IIS just shut me down if I used worker process.

So anybody nows what causes this strange behavior?

Upvotes: 4

Views: 2917

Answers (1)

Katie Kilian
Katie Kilian

Reputation: 6983

IIS is welcome to recycle the application pool any time it wants to. This is what is stopping your process.

You should move your process into its own application that runs as a Windows Service.

Upvotes: 3

Related Questions