1

I have a problem with running wkhtmltopdf.exe from my web application depolyed onto Windows Server 2012. Seems like my application pool does not have permissions to perform this action, although web application nor the exe does not throw any errors. It simply doesnt execute.

What i've done so far:

  • Grant full permissions to application pool to exe and all directories related to it from Properties -> Security
  • Tried to use other identities in application pool besides application pool identity
  • Tried to execute it via WCF and Windows Service
  • Set all files, folders in working directory to not read-only
  • Set exe to run as administrator

I used procexp to see if the exe is executed, but its not - no wkhtmltopdf.exe process appears to background. I dont need to show UI, I just need to run it on background and let it do its job - generate pdf out of html.

When I run this exe manually from command line, it is working fine. I also deployed my web app onto another win 2012 r2 server, made new application pool with default settings and applocation pool indentity, set the permissions for files/folders and exe. Suprisingly it was working over there.

So I think im missing something, but i cant figure it out. I thin that the first server have some kind of special configuration on ASPUSER or IIS or Admin permissions or something.

Does anyone know how to determine whether application pool has *.exe executing permissions on its users? Or maybe this problem seems familiar to someone? Is it possible to explicitly tell IIS or application pool NOT to run exe's?

Marek
  • 261
  • 4
  • 14

1 Answers1

0

Assuming you are using C# or VB.NET: See: How to use wkhtmltopdf.exe in ASP.net

You can use the .NET dll wrapper, which is in my opinion a cleaner solution then executing exe files from C# or VB.NET. This also allows you to debug calls.

Community
  • 1
  • 1
  • 1
    External wrappers are not helping me at the moment. Wrappers will eventually to the same thing that i do - call Process.Start on wkhtmltopdf.exe. I basically wrote my own wrapper to it. – Marek Apr 13 '16 at 06:25
  • This is a wrapper around the DLL not the executable. So it does not call Process.Start for the wkhtmltopdf.exe – Wilko van der Veen Apr 13 '16 at 06:57