[IIS 7.5 / Windows 7 / Visual Studio 2012]
I am trying to have my MVC app run an external command line tool located on the same machine.
I gave execute permissions to IIS_USRS to the whole folder that contains the tool.
I invoke it with:
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.WindowStyle = ProcessWindowStyle.Normal;
startInfo.FileName = myPath;
startInfo.Arguments = myArguments;
PartialRunProcess = Process.Start(startInfo);
No exceptions (path is right), but the process exists rightaway with ExitCode 255
I can execute the process manually.
What could be the cause ?
Exit code 255 sounds like a .NET exception within the tool (target application) you're running. You'll not be able to catch this exception in your code.
I would register a debugger for the target application to see what exception it throws:
Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options
Create a key with the name of the executable you're starting
Create a string called Debugger
Give it a value, e.g. vsjitdebugger.exe
if it's a .NET application
This will start the debugger and you can catch exceptions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With