jatpat / excellibrary

Automatically exported from code.google.com/p/excellibrary
0 stars 0 forks source link

File IO exception when used in web application #73

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using the latest version of the DLL (compiled 12 Feb 2009) I receive the 
following exception when trying to access an XLS file from a local web 
application:

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

Source: mscorlib

Method: Void Check(System.Object, System.Threading.StackCrawlMark ByRef, 
Boolean)

Stack Trace:    at System.Security.CodeAccessSecurityEngine.Check(Object 
demand, StackCrawlMark& stackMark, Boolean isPermSet)
   at System.Security.CodeAccessPermission.Demand()
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at System.IO.File.Open(String path, FileMode mode, FileAccess access, FileShare share)
   at ExcelLibrary.Office.CompoundDocumentFormat.CompoundDocument.Open(String file)
   at ExcelLibrary.Office.CompoundDocumentFormat.CompoundDocument.Read(String file)
   at ExcelLibrary.Office.Excel.Workbook.Open(String file)
   at rbm.Portal.DAL.Excel.GetWorkbookData(String strFile, String strWorkbook) in c:\inetpub\wwwroot\rbm\App_Code\DataAccess\Excel.cs:line 79

When I debug the application is VS2008 I don't receive this error.  The 
security settings folder holding the Excel file gives 'Everyone' full access.  
Can the DLL be used in a web environment?

Original issue reported on code.google.com by markpirv...@gmail.com on 13 Oct 2010 at 3:17

GoogleCodeExporter commented 9 years ago
same issue...no solution??

Original comment by brobert...@yahoo.com on 19 Nov 2010 at 3:20

GoogleCodeExporter commented 9 years ago
Most likely a permission issue. Try do File.Open() directly and see what 
happens.

Original comment by jetcat on 1 Mar 2013 at 11:08