2011-10-10 9 views
8

पर प्रारंभिक विफलता एक्सेल फाइलें उत्पन्न करने के लिए मैं अपने एएसपी.नेट एमवीसी 3 ऐप में ईपीप्लस 2.8.0.2 लाइब्रेरी का उपयोग कर रहा हूं। यह एप्लिकेशन विंडोज सर्वर 2003 आर 2 पर आईआईएस 6 पर चलता है।IsolatedStorage

हमलावर लाइन यह है:

xlsdoc.GetAsByteArray 

xlsdoc एक सही ढंग से लोड ExcelPackage वस्तु है।

छोटे उत्पादन जनरेट कर रहा है ठीक है, लेकिन बड़ा उत्पादन जनित करने में त्रुटि पैदा करता है:

System.IO.IsolatedStorage.IsolatedStorageException: Initialization failed. 
    at System.IO.IsolatedStorage.IsolatedStorageFile.Init(IsolatedStorageScope scope) 
    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.CompressEmulationStream.Write(Byte[] buffer, Int32 offset, Int32 count) 
    at MS.Internal.IO.Packaging.CompressStream.Write(Byte[] buffer, Int32 offset, Int32 count) 
    at MS.Internal.IO.Zip.ProgressiveCrcCalculatingStream.Write(Byte[] buffer, Int32 offset, Int32 count) 
    at MS.Internal.IO.Zip.ZipIOModeEnforcingStream.Write(Byte[] buffer, Int32 offset, Int32 count) 
    at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder) 
    at System.IO.StreamWriter.Write(String value) 
    at System.IO.TextWriter.Write(String format, Object arg0) 
    at OfficeOpenXml.ExcelWorksheet.UpdateRowCellData(StreamWriter sw) 
    at OfficeOpenXml.ExcelWorksheet.SaveXml() 
    at OfficeOpenXml.ExcelWorksheet.Save() 
    at OfficeOpenXml.ExcelWorkbook.Save() 
    at OfficeOpenXml.ExcelPackage.GetAsByteArray(Boolean save) 
    at OfficeOpenXml.ExcelPackage.GetAsByteArray() 
    at ReportCenterLib.ReportGenerator.GenerateStream(DataTable result, String reporttitle, String inputparmstr, String conndescs, String username, String outputtype, String templatefile) in D:\PROJECTS\reportcentermvc\sources\ReportCenterLib\ReportGenerator.vb:line 450 
    at ReportCenterMVC.ReportCenterMVC.ReportController.Generate(Int64 id, IList`1 conns, IDictionary`2 parms, String outputtype) in D:\PROJECTS\reportcentermvc\sources\ReportCenterMVC\Controllers\ReportController.vb:line 218 

मुझे लगता है EPPlus IsolatedStorage का उपयोग कर अस्थायी फ़ाइलों को बनाने की कोशिश करता है, लेकिन IsolatedStorage को लिखने की अनुमति नहीं थी। मैंने एप्लिकेशन पूल पहचान को 'स्थानीय सिस्टम' में बदल दिया है, और त्रुटि गायब हो जाती है।

'नेटवर्क सेवा' पहचान का उपयोग करते समय मैं इस त्रुटि से कैसे बचूं?

+0

संबंधित समस्या और किसी और के लिए यह जानकारी अधिक जानकारी: http://epplus.codeplex.com/workitem/14762 – richardtallent

उत्तर

8

कोई blogged about this। त्रुटि वह मिल गया (पहुँच से मना कर) त्रुटि है कि मुझे मिल से अलग था, लेकिन उनके समाधान मेरे लिए काम किया:

  • उस फ़ोल्डर
  • को हर किसी के लिए C:\Documents and Settings\Default User\Local Settings\Application Data\IsolatedStorage
  • को लेखन पहुँच में सर्वर पर एक फ़ोल्डर बनाएँ
+1

2014-08-05 पर मृत लिंक – JerryOL

0

यहाँ पर चर्चा की: http://openxmldeveloper.org/

निकालने:

create folder named IsolatedStorage at the following path "C:\Documents and Settings\Default User\Local Settings\Application Data" and give the permission for IIS_WPG to modify and write. This solves the problem on the windows server 2003