PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Security Exception - File IO Permission
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1749
Page 1 of 1

Author:  Simon-BMJ [ Tue Aug 23, 2011 11:41 am ]
Post subject:  Security Exception - File IO Permission

Hi,

I have recently started using PDFsharp and have run into an error.

I built my PDF library on a windows application first of all and everything worked fine, PDF built, and it looked great.

I've now moved that library over to my web application (running on local server) and it hits an error when trying to build the PDF.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Source of Error: XFont header = new XFont("Arial", 20, XFontStyle.Bold);

The application is running on 'Full Trust'.

Any ideas on the fix?

Thanks in advance!

Author:  Thomas Hoevel [ Tue Aug 23, 2011 3:45 pm ]
Post subject:  Re: Security Exception - File IO Permission

Which user account do you use for your application pool?
You can try System to see if it's a matter of insufficient privileges.

Author:  Simon-BMJ [ Wed Aug 24, 2011 9:26 am ]
Post subject:  Re: Security Exception - File IO Permission

I just tried switching to System and it worked fine.

Can't see why it isn't working on ApplicationPoolIdentity though, I've given full access to all users including IIS. Any ideas?

Thanks

Author:  dtrainSA [ Wed Aug 24, 2011 2:26 pm ]
Post subject:  Re: Security Exception - File IO Permission

IIS shouldn't have full access to your application directory. Network Service is the account that ASP.NET "usually" uses to access the directory.

Does the Network Service directory have full access?

Does the AppPool identity account have full access?

Author:  Simon-BMJ [ Wed Aug 24, 2011 2:44 pm ]
Post subject:  Re: Security Exception - File IO Permission

Setting the Network Service user to have full rights against the dll seems to have solved it.

Thanks!

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/