Valdas
Valdas

Reputation: 370

ApplicationPoolIdentity permission to access/create printer DC

I have a simple Windows console app that generates a PDF file and it uses printer DC for its inner workings to render appropriate boundaries and font sizes. I do not know how exactly it works on the inside, but I must use it and can not substitute it for an alternative.

When I run in directly through CMD it works fine.

When I run it through a ASP.NET webapp it fails to access or create a printer DC. It says so in the log file and output PDF file is all crooked.

If in IIS Manager I change application pools identity to a NetworkService or a regular Windows user, then it works fine, but the customer wants to use ApplicationPoolIdentity.

On some of my older test machines it works fine with ApplicationPoolIdentity, but I can not make it work on any new machine. I tried Windows 10 and 11, Windows Server 2019 and 2022. In IIS Manager I set DefaultAppPool advanced setting Load User Profile to True, and in default printer properties Security tab I added IIS AppPool\DefaultAppPool and gave it all permissions and restarted the computer. It still can not access printer DC.

Anyone knows how to give ApplicationPoolIdentity permission to access/create printer DC?

Upvotes: 0

Views: 31

Answers (0)

Related Questions