Home > Blockchain >  Process.Start Hanging, Not Starting Process
Process.Start Hanging, Not Starting Process

Time:05-11

I have an api running in IIS written in .net framework 4.7.1 that needs to start a console app, but when I call Process.Start(@"\\boxName\d$\moreFoldersHere\FileName.exe"), it hangs on execution, and the console app does not start. I have verified that the app pool under which the site is running has full perms to both the directory containing the exe and the exe itself, and I have made the service account an administrator on the box with no luck. I have no trouble running the app, but even when I set the app pool to run as myself, the behavior does not change.

Purely for context... the api needs to trigger a process that may take an unreasonable amount of time to complete. Obviously I don't want the api response waiting on it, so I don't want to wait for the result of the process; I just want to fire-and-forget. I also don't want iis cleanup killing it after some period of "no activity", and I need to potentially have multiple instances of this same process executing at the same time on the same box.

CodePudding user response:

I found the answer... In IIS, in the App pool, LoadUserProfile needs to be set to True.

I'm not sure why it defaulted to False, but everything is working fine now.

CodePudding user response:

Since it's a console app, your issue is likely the need to read the output. See this answer.

  • Related