exe does not complete under IIS

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mo

    #1

    exe does not complete under IIS

    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);
    }
  • Angel Hernandez

    #2
    Re: exe does not complete under IIS

    Hi,

    I hope this helps



    however, I don't think it's a good practice to do what you want because of
    the security issues related =(

    Cheers,


    --
    Angel J. Hernández
    MCP,MCAD,MCSD,M CDBA
    Microsoft MVP (ASP/ASP.NET)
    mailto:angeljes us14@hotmail.co m

    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
    Technical Solution Architect




    "Mo" <le_mo_mo@yahoo .comwrote in message
    news:1cf335d6-0cf3-400c-9e88-82061d0cc5a9@s9 g2000prg.google groups.com...
    >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);
    }

    Comment

    Working...