Security Exception while trying ExcelReaderFactory.CreateOpenXmlReader(stream);

Mar 17, 2010 at 10:59 PM

I'm using ExcelDataReader in ASP.NET 3.5 to read xls and xlsx files and it works flawlessly for xls, but generates an error while trying to read xlsx from the same directory on my local developing computer:

excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream);

Security Exception

Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

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

 

Anybody experienced the same problem?


Thanks in advance,

Eugene

Mar 28, 2011 at 7:00 PM

I am currently experiencing the same problem.  Were you ever able to figure out a solution for this?

Thanks,

Jon

Apr 14, 2011 at 7:02 PM

Is there an update to this problem?  I am looking for a solution myself as well.  Any info is appreciated.  Thanks.

Apr 15, 2011 at 7:12 PM

I too am experiencing the very same issue. The code works fine for .xls files with the CreateBinaryReader method, yet throws the Security Exception on .xlsx files with the CreateOpenXmlReader method. If anyone has found the solution for this, please post. Thank you.

Sep 9, 2011 at 2:53 PM

I have the same problem, somebody found the solution to this issue?.

Thank you.

Dec 9, 2011 at 7:05 PM

any updates on this issue?  i am running into the same thing.

Aug 31, 2012 at 3:11 PM

I am receiving this issue when trying to use the dll in my website hosted on a Rackspace cloud server. It works fine locally.

Aug 28, 2013 at 7:11 PM
Edited Aug 28, 2013 at 7:11 PM
CHADDOX wrote:
I am receiving this issue when trying to use the dll in my website hosted on a Rackspace cloud server. It works fine locally.
I'm having the same problem. Local it all fine. On web server it not working.
May 7 at 7:51 AM
I'm having the same problem on my server, somebody have a fix?
Developer
May 7 at 9:02 AM
Xlsx files have to be unzipped. Does your application have permissions to the temp folder?