I have an ASP.Net web application that uses a Process to execute a command line tool. The parameters to the command line tool are provided as input by the user.
If there is something wrong with the parameters, then the command line tool crashes. Here's how I am checking whether the the Process exited successfully or not:
Process.Start();
Process.WaitForExit();
if(Process.ExitCode==0)
return true;
else
return false;
Initially, I hosted this application on my PC using IIS, and it was working as expected (when the command line tool crashes, Process.ExitCode gives a non-zero value).
But when I hosted it on a server, I found that when the command line tool crashes, Process.ExitCode gives 0, and my application proceeds as if the everything went right. On debugging, I found that when the command line tool crashes, JIT debugger dialog box pops up at the server. After disabling JIT debugging, a different JIT dialog box pops up:
An unhandled Microsoft .Net exception occurred in [command-line tool name]. Just-in-time debugging this exception failed with the following error: Visual Studio cannot debug this unhandled exception because it comes from a version of Microsoft .Net framework that is newer than the installed version of Visual Studio.TO debug this exception, use a more recent version of Visual Studio. Check the documentation-index for 'Just in-time debugging, errors' for more information
Both my PC, and the server have Visual Studio 2010 Ultimate installed on them. Why this different behavior then? How can I resolve this problem?