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.StartIn fo.FileName = MyExecutable;
process.StartIn fo.WorkingDirec tory = new
FileInfo(MyExec utable).Directo ryName;
process.StartIn fo.CreateNoWind ow = true;
process.StartIn fo.Arguments = arguments;
process.StartIn fo.UseShellExec ute = false;
process.StartIn fo.RedirectStan dardError = true;
process.Start() ;
Trace.Warn("Pro cess Started");
try
{
if (!process.WaitF orExit(waitForE xitMilliseconds ))
{
ShowError("The application did not complete within an appropriate time
period.");
}
else
{
string executableError Message = process.Standar dError.ReadToEn d();if
(executableErro rMessage.Length != 0)
{
Trace.Warn(exec utableErrorMess age);
ShowError("An error occurred running the executable: " +
executableError Message);
}
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.StartIn fo.FileName = MyExecutable;
process.StartIn fo.WorkingDirec tory = new
FileInfo(MyExec utable).Directo ryName;
process.StartIn fo.CreateNoWind ow = true;
process.StartIn fo.Arguments = arguments;
process.StartIn fo.UseShellExec ute = false;
process.StartIn fo.RedirectStan dardError = true;
process.Start() ;
Trace.Warn("Pro cess Started");
try
{
if (!process.WaitF orExit(waitForE xitMilliseconds ))
{
ShowError("The application did not complete within an appropriate time
period.");
}
else
{
string executableError Message = process.Standar dError.ReadToEn d();if
(executableErro rMessage.Length != 0)
{
Trace.Warn(exec utableErrorMess age);
ShowError("An error occurred running the executable: " +
executableError Message);
}
Comment