IIS7 does not start my Exe file by Process Start

后端 未结 3 723
孤城傲影
孤城傲影 2020-11-30 06:12

I\'ve read a lot of articles. But as far as I know I\'ve done all. On local computer VS2010 all works fine. The problem occurs only when working on IIS7 Server.

I wan

相关标签:
3条回答
  • 2020-11-30 06:37

    What helped me is this: Setting in Application Pool Identity = LocalSystem

    1. Open Application Pools
    2. Find your pool (by default DefaultAppPool)
    3. Click on "Advanced settings"
    4. Change Identity to "LocalSystem"

    Hopefully it will help somebody...

    0 讨论(0)
  • 2020-11-30 06:49
    var p = new Process
    {
        StartInfo =
        {
            FileName = Path,    
            UseShellExecute = false,
        }
    };
    p.Start();
    
    0 讨论(0)
  • 2020-11-30 06:53

    Edit:

    After a long journey, me and Nasenbaer have found the following. The possible reasons for IIS to fail run an EXE are:

    1. Lack of permissions for IIS Users, such as the application pool user, or the Network service (in IIS6).
    2. x86 EXE running on x64 machine issues.
    3. Typical EXE failure issues such as missing dependencies.

    Original answer:

    You need to assign FullControl security permissions for the IIS AppPool\DefaultAppPool user, on the directory the EXE is located in. This is the user that is trying to run the process (assuming you are using the DefaultAppPool), and without the proper permissions, it is unable to do so.

    When you run the EXE manually, you are using the Windows logged in user. This is why you are able to lunch it manualy. The IIS uses the Application Pool user.

    To add permissions just do the following:

    1. Go to directory properties
    2. Security tab
    3. Edit.. -> Add the IIS AppPool\DefaultAppPool
    4. Check for it the FullControl

    Screenshot:

    enter image description here enter image description here

    0 讨论(0)
提交回复
热议问题