Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Process exists with ExitCode 255

[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 ?

like image 659
AnalogKid17 Avatar asked Oct 21 '22 08:10

AnalogKid17


1 Answers

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:

  1. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options

  2. Create a key with the name of the executable you're starting

  3. Create a string called Debugger

  4. Give it a value, e.g. vsjitdebugger.exe if it's a .NET application

This will start the debugger and you can catch exceptions.

like image 135
Thomas Weller Avatar answered Oct 23 '22 02:10

Thomas Weller