pita
pita

Reputation: 537

Add permission for ASPNET account

I am using the PDFsharp (which is used to generate pdf file in asp.net), and got an error "Access to the path 'C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\10.0\Tax_receipt.pdf' is denied."

I guess it is trying to write file to this folder so I tried to add an ASPNET account with write permission to that folder. I use "computer name\ASPNET" which can't be found and "Network Service" which didn't work.

Does anyone know how to add permission?? Many thanks!!

edit:

I use MemoryStream instead of FileStream finally, and this will avoid to create physical file.

Upvotes: 1

Views: 5344

Answers (1)

Pencho Ilchev
Pencho Ilchev

Reputation: 3241

My guess is that you are hosting on IIS v7.5.

If this is the case, you need to grant ACL permissions to the application pool identity of the application pool to which your asp.net application is assigned.

For example, if you have assigned your IIS application to the Default Application pool (DefaultAppPool) you need to grant the permissions to IIS AppPool\DefaultAppPool (make sure the IIS server machine name is selected as the location).

Here are some related resources:

An MS support article

A similar question on SO

Upvotes: 1

Related Questions