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?
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.
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.
Member
112 Points
112 Posts
Not able to run Process diagnostic when app runs on IIS
Jul 23, 2019 06:15 PM|dbqasp|LINK
I am trying to run Symantec Endpoint Protection exe on uploaded file from an MVC app.
Code is fairly simple
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!
All-Star
194524 Points
28081 Posts
Moderator
Re: Not able to run Process diagnostic when app runs on IIS
Jul 23, 2019 06:26 PM|Mikesdotnetting|LINK
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.
Contributor
4963 Points
4213 Posts
Re: Not able to run Process diagnostic when app runs on IIS
Jul 23, 2019 06:40 PM|DA924|LINK
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.
All-Star
194524 Points
28081 Posts
Moderator
Re: Not able to run Process diagnostic when app runs on IIS
Jul 23, 2019 09:10 PM|Mikesdotnetting|LINK