the issue I'm facing is this:
I'm trying to start AcrobatReader from my C# WebApplication using a Process.
https://msdn.microsoft.com/en-us/library/system.diagnostics.process(v=vs.110).aspx
When I'm running the application in IIS Express(running under my default user account) everything goes right and I can open the file I want on Acrobat Reader.
Instead, when I'm trying to deploy on IIS(running under IIS APPPOOL\xxx) the process can't start AcrobatReader.
I've already tried to assign permissions on AcrobatReader to IIS_IUSRS and also to IIS APPPOOL\xxx but nothing change
Tried also to add IIS APPPOOL\xxx to administrators group but no luck
` `ProcessStartInfo info = new ProcessStartInfo();
info.FileName = Constants.ACROBAT_READER_PATH;
info.Arguments = args;
info.Verb = "Printto";
info.CreateNoWindow = true;
info.WindowStyle = ProcessWindowStyle.Hidden;
info.UseShellExecute = false;
info.Domain = Environment.MachineName;
info.UserName = "AdminUser";
string password = "AdminPassword";
System.Security.SecureString securePassword = new System.Security.SecureString();
foreach (char c in password)
securePassword.AppendChar(c);
info.Password = securePassword;
try
{
//The following security adjustments are necessary to give the new
//process sufficient permission to run in the service's window station
//and desktop. This uses classes from the AsproLock library also from
//Asprosys.
IntPtr hWinSta = GetProcessWindowStation();
WindowStationSecurity ws = new WindowStationSecurity(hWinSta,
System.Security.AccessControl.AccessControlSections.Access);
ws.AddAccessRule(new WindowStationAccessRule("AdminUser",
WindowStationRights.AllAccess, System.Security.AccessControl.AccessControlType.Allow));
ws.AcceptChanges();
IntPtr hDesk = GetThreadDesktop(GetCurrentThreadId());
DesktopSecurity ds = new DesktopSecurity(hDesk,
System.Security.AccessControl.AccessControlSections.Access);
ds.AddAccessRule(new DesktopAccessRule("AdminUser",
DesktopRights.AllAccess, System.Security.AccessControl.AccessControlType.Allow));
ds.AcceptChanges();
using (Process process = Process.Start(info))
{
}
}
catch (Exception ex)
{
}
Thank you for your time