I'm trying to start a process from an ASP.NET Web application. The
reason I need this is to encapsulate a (unmanaged) DLL that sometimes
crashes. If I run this DLL directly with P/Invoke from within my ASP.NET
application, this sometimes crashes the whole IIS.
So the idea is to have a separate server which accepts requests (via a
socket connection), calls the DLL with the given parameters and returns
the results.
This works well when I start the server from a console, but it needs to
be started automatically from the Web application. Currently, I'm doing
it this way:
Process serverProcess;
Int32 port = 13000;
String server = "127.0.0.1" ;
for (int i=0; i < 3 && client == null; i++) {
try {
client = new TcpClient(serve r, port);
} catch (SocketExceptio n e) {
// probably, the server is not running, so start it now!
if (serverProcess != null) {
serverProcess.K ill();
serverProcess = null;
}
serverProcess = new Process();
serverProcess.S tartInfo.FileNa me = exePath;
serverProcess.S tartInfo.Argume nts = "127.0.0.1 13000";
serverProcess.S tartInfo.Window Style = ProcessWindowSt yle.Normal;
serverProcess.S tart();
}
}
But this "serverProcess. Start()" doesn't work :-(
I get an error dialog "JIT Debugging", "JIT Debugging failed with the
following error: Zugriff verweigert (access denied)", "JIT Debugging was
initiated by the user account "\myMachine\ASP NET". I have added ASPNET
to the Debugger Users group - but that doesn't seem to change anything.
I've also tried it with ProcessWindowSt yle.Hidden - but that doesn't
improve things either...
Any ideas how to solve this?
kind regards,
david