My web application encounter the "sprឹ' threw an exception" when we generate excel (Refer to the stack trace at bottom).
These are the troubleshooting I have done from my side:
- The issue happen once a while. User might able to generate excel for the first time, and they might get the error when then generate excel subsequently.
- I can generate excel again after I recycle app pool
- When the web application is not able to generate excel, I will host a duplicated web application in IIS. The duplicated web application able to generate excel while the original web application is not able to generate excel. (both web application are sharing the same app pool)
The Spire.XLS version is 11.12.2.5040.
Let me know if any information is needed from me
- Code: Select all
12:12:01.430 System.TypeInitializationException: The type initializer for 'Spire.Xls.Core.Spreadsheet.XlsPageSetupBase' threw an exception. ---> System.TypeInitializationException: The type initializer for 'sprឹ' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Gdip' threw an exception. ---> System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
at System.Drawing.SafeNativeMethods.Gdip.Initialize()
at System.Drawing.SafeNativeMethods.Gdip..cctor()
--- End of inner exception stack trace ---
at System.Drawing.SafeNativeMethods.Gdip.GdipCreateBitmapFromScan0(Int32 width, Int32 height, Int32 stride, Int32 format, HandleRef scan0, IntPtr& bitmap)
at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
at System.Drawing.Bitmap..ctor(Int32 width, Int32 height)
at sprឹ..cctor()
--- End of inner exception stack trace ---
at Spire.Xls.Core.Spreadsheet.XlsPageSetupBase.PaperSizeEntry..ctor(Double width, Double height, MeasureUnits units)
at Spire.Xls.Core.Spreadsheet.XlsPageSetupBase..cctor()
--- End of inner exception stack trace ---
at Spire.Xls.Core.Spreadsheet.XlsWorksheet.InitializeCollections()
at Spire.Xls.Core.Spreadsheet.XlsWorksheetBase..ctor(Object A_0)
at Spire.Xls.Core.Spreadsheet.XlsWorksheet..ctor(Object A_0)
at Spire.Xls.Core.Spreadsheet.Collections.XlsWorksheetsCollection.Add(String sheetName)
at Spire.Xls.Core.Spreadsheet.XlsWorkbook.ᜀ(Int32 A_0)
at Spire.Xls.Core.Spreadsheet.XlsWorkbook..ctor(Object A_0)
at Spire.Xls.Workbook..ctor()
at PlanWorthFactor_WorkFlow.svrExtraction.GenerateCIMBBulkOutput(List`1 bulkDataList, String tempPath, String fileNamePrefix)
at PlanWorthFactor_WorkFlow.svrExtraction.fnGACNewCIMBExtraction(WebResponse resp)