I have the code below which sets arguments for an executable (exe) and
run it in a web page. the code works fine if in debug mode and I can
run the executable through command prompt but under IIS control it
appears that it does not execute and I can not find any errors. it has
got to be something about permissions but I have execute permissions
set to scripts and executables set. I have assigned full permissions
to ASPNEt, Network Service and host of other accounts without any
luck. The process returns a value of "0" after completion but it
really does not do what it is supposed to do. Does anybody have any
suggestions about what could be wrong?
Process process = new Process();
process.StartInfo.FileName = MyExecutable;
process.StartInfo.WorkingDirectory = new
FileInfo(MyExecutable).DirectoryName;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.Arguments = arguments;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardError = true;
process.Start();
Trace.Warn("Process Started");
try
{
if (!process.WaitForExit(waitForExitMilliseconds))
{
ShowError("The application did not complete within an appropriate time
period.");
}
else
{
string executableErrorMessage = process.StandardError.ReadToEnd();if
(executableErrorMessage.Length != 0)
{
Trace.Warn(executableErrorMessage);
ShowError("An error occurred running the executable: " +
executableErrorMessage);
}