Hi,
I have tried multiple ways but whenever I use Parallel.ForEach and try to call any methods for aspose, it gives me some wierd exceptions from aspose.cells.
E.g. code
Parallel.ForEach(beginningMsgs, pnlData =>
{
CurrentSheet.Cells.InsertRow(currentRowNum);
});
gives exception as below:
Object reference not set to an instance of an object.
at ....(Int32 )
at Aspose.Cells.Cell.InsertRows( , Int32 , Int32 , Int32 , Worksheet , Boolean )
at Aspose.Cells.RowCollection.InsertRows(Int32 , Int32 , )
at Aspose.Cells.Cells.(Int32 , Int32 , )
at Aspose.Cells.Cells.InsertRows(Int32 rowIndex, Int32 totalRows)
at Aspose.Cells.Cells.InsertRow(Int32 rowIndex)
AsposeReportGenerator.cs:line 161
at System.Threading.Tasks.Parallel.<>c__DisplayClass2d`2.b__23(Int32 i)
at System.Threading.Tasks.Parallel.<>c__DisplayClassf`1.b__c()
The same code works fine when using
beginningMsgs.ForEach(pnlData =>
{
CurrentSheet.Cells.InsertRow(currentRowNum);
}
);
Does that mean Aspose doesn't support multithreading??
Nirdesh