locked
Not able to run Process diagnostic when app runs on IIS RRS feed

  • Question

  • User1396448631 posted

    I am trying to run Symantec Endpoint Protection exe on uploaded file from an MVC app.

    Code is fairly simple

    var filePath = @"C:\Temp\9d2b9311_51F649F0.pdf"; // test
    var exePath = @"C:\Program Files (x86)\Symantec\Symantec Endpoint Protection\DoScan.exe";
    var startInfo = new ProcessStartInfo();
    startInfo.FileName = Path.GetFileName(exePath);
    startInfo.WorkingDirectory = Path.GetDirectoryName(exePath);
    startInfo.Arguments = "/ScanFile " + filePath;
    using (var process = new Process())
    {
      process.StartInfo = startInfo;
      process.Start();
      int id = process.Id;
      process.WaitForExit();
    }

    The app runs fine on IIS express. It updates the Symantec log file once the scan is over.

    However, the process does not run in IIS.

    Can you please tell me exactly what and where I need to add/modify in IIS Manager for the exe to run?

    Thank you!

    Tuesday, July 23, 2019 6:15 PM

Answers

  • User-821857111 posted

    You probably need to change the app pool identity to a local service  or network service account. It's unlikely that the applicationpool identity has enough privileges to run an exe outside of its process.

    Go to the application pools in IIS Manager and click advanced settings for the relevant one. You should see identity about a third of the way down.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 23, 2019 6:26 PM

All replies

  • User-821857111 posted

    You probably need to change the app pool identity to a local service  or network service account. It's unlikely that the applicationpool identity has enough privileges to run an exe outside of its process.

    Go to the application pools in IIS Manager and click advanced settings for the relevant one. You should see identity about a third of the way down.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 23, 2019 6:26 PM
  • User1120430333 posted

    I am trying to run Symantec Endpoint Protection exe on uploaded file from an MVC app.

    It sounds like snake-oil I have never seen used in any ASP.NET Web solution.

    The app runs fine on IIS express. It updates the Symantec log file once the scan is over.

    That can be the case that it runs on IIS Express, since it's a development solution used by Visual Stuido.

    However, the process does not run in IIS.

    At least,  you found that all things that work using IIS Express doesn't mean it necessarily is going to work on IIS. 

    You can try to find out/debug why is doesn't work on local IIS on your development machine by pushing the Visual Stuido ASP.NET project to local IIS and disconnect from using IIS Express.

    The link doesn't solely apply to VS 2017 and does apply to other versions of VS not involving ASP.NET Core.

     https://docs.microsoft.com/en-us/visualstudio/debugger/how-to-enable-debugging-for-aspnet-applications?view=vs-2017

    However, if the snake-oil doesn't work on IIS, then it is what it is.

    Tuesday, July 23, 2019 6:40 PM
  • User-821857111 posted

    I am trying to run Symantec Endpoint Protection exe on uploaded file from an MVC app.

    It sounds like snake-oil I have never seen used in any ASP.NET Web solution.

    It's not an unusual requirement to use an AV solution to scan uploads.

    Tuesday, July 23, 2019 9:10 PM