问题
IIS on WindowsServer 2012, ASP.NET MVC
It is very bad to run an IIS 8.5 site as LocalSystem, but that is the only way I can get this exe to run. I need to be able to have the site run this:
var pdfProcess = new Process();
pdfProcess.StartInfo.FileName = SomeExeInProgramFiles;
pdfProcess.StartInfo.Arguments = stuff;
pdfProcess.StartInfo.WorkingDirectory = docPath; //!!!!This is really important!!!!!
pdfProcess.Start();
Running windows 2012, how can I let my AppPoolIdentity site run the above exe (only) from Program Files?
I have granted full control to the folder holding the exe to IIS APPPOOL\my pool name as a test, but still it won't run. Only if I set the app pool to run under LocalSystem (yicks)
Note: The EXE is a tool that needs to run to do tasks. We have no other option than to run it on request from the web site. We didn't write or have access to the exe.
回答1:
Try to set the Load User Profile = True
in the Application Pools
Advanced Settings
.
Then I think you should be able to execute the process using the ApplictionPoolIdentity
, so you can avoid using the LocalSystem account.
来源:https://stackoverflow.com/questions/26823149/iis-localsystem-only-will-run-my-exe