Epplus桌面应用程序 – 无法确定域的身份

我刚刚开始我的excel interop代码epplus,做了一个excel文档时,但我不能读取现有的文件。 我search,但每个结果都与Web应用程序有关,我正在开发一个桌面应用程序。 我的代码非常简单:

Dim File As FileInfo = New FileInfo(DosyaAd) Using package As New ExcelPackage(File) Dim She As ExcelWorksheet She = package.Workbook.Worksheets("BF") End using 

我得到这个错误:她= package.Workbook.Worksheets(“BF”)

 System.IO.IsolatedStorage.IsolatedStorageException was unhandled by user code HResult=-2146233264 Message=Unable to determine the identity of domain. Source=mscorlib StackTrace: at System.IO.IsolatedStorage.IsolatedStorage._GetAccountingInfo(Evidence evidence, Type evidenceType, IsolatedStorageScope fAssmDomApp, Object& oNormalized) at System.IO.IsolatedStorage.IsolatedStorage.GetAccountingInfo(Evidence evidence, Type evidenceType, IsolatedStorageScope fAssmDomApp, String& typeName, String& instanceName) at System.IO.IsolatedStorage.IsolatedStorage._InitStore(IsolatedStorageScope scope, Evidence domainEv, Type domainEvidenceType, Evidence assemEv, Type assemblyEvidenceType, Evidence appEv, Type appEvidenceType) at System.IO.IsolatedStorage.IsolatedStorage.InitStore(IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType) at System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType) at MS.Internal.IO.Packaging.PackagingUtilities.ReliableIsolatedStorageFileFolder.GetCurrentStore() at MS.Internal.IO.Packaging.PackagingUtilities.ReliableIsolatedStorageFileFolder..ctor() at MS.Internal.IO.Packaging.PackagingUtilities.GetDefaultIsolatedStorageFile() at MS.Internal.IO.Packaging.PackagingUtilities.CreateUserScopedIsolatedStorageFileStreamWithRandomName(Int32 retryCount, String& fileName) at MS.Internal.IO.Packaging.SparseMemoryStream.SwitchModeIfNecessary() at MS.Internal.IO.Packaging.SparseMemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count) at MS.Internal.IO.Packaging.DeflateEmulationTransform.Decompress(Stream source, Stream sink) at MS.Internal.IO.Packaging.CompressEmulationStream..ctor(Stream baseStream, Stream tempStream, Int64 position, IDeflateTransform transformer) at MS.Internal.IO.Packaging.CompressStream.ChangeMode(Mode newMode) at MS.Internal.IO.Packaging.CompressStream.Seek(Int64 offset, SeekOrigin origin) at MS.Internal.IO.Zip.ProgressiveCrcCalculatingStream.Seek(Int64 offset, SeekOrigin origin) at MS.Internal.IO.Zip.ZipIOModeEnforcingStream.Read(Byte[] buffer, Int32 offset, Int32 count) at System.IO.StreamReader.ReadBuffer(Char[] userBuffer, Int32 userOffset, Int32 desiredChars, Boolean& readToUserBuffer) at System.IO.StreamReader.Read(Char[] buffer, Int32 index, Int32 count) at System.IO.StreamReader.ReadBlock(Char[] buffer, Int32 index, Int32 count) at OfficeOpenXml.ExcelWorksheet.GetWorkSheetXml(Stream stream, Int64 start, Int64 end, Encoding& encoding) at OfficeOpenXml.ExcelWorksheet.CreateXml() at OfficeOpenXml.ExcelWorksheet..ctor(XmlNamespaceManager ns, ExcelPackage excelPackage, String relID, Uri uriWorksheet, String sheetName, Int32 sheetID, Int32 positionID, eWorkSheetHidden hide) at OfficeOpenXml.ExcelWorksheets..ctor(ExcelPackage pck, XmlNamespaceManager nsm, XmlNode topNode) at OfficeOpenXml.ExcelWorkbook.get_Worksheets() at OfficeOpenXml.ExcelWorkbook.GetDefinedNames() at OfficeOpenXml.ExcelPackage.get_Workbook() ......... 

如果此工作簿是在Microsoft Office中生成的或者通过interop生成的,则工作簿可能包含EPPLus库中不可用的function,例如行和主题以及此处列出的其他function。

我自己并没有经历过,但是我听到别人的意见,当“工作表”包含大量内容时,会出现问题。