System.AggregateException when cloning a slide

System.InvalidOperationException: Collection was modified; enumeration operation may not execute.

at System.Collections.ArrayList.ArrayListEnumeratorSimple.MoveNext()

at Aspose.Slides.Pptx.GradientFormatEx.(GradientFormatEx )

at Aspose.Slides.Pptx.FillFormatEx.(FillFormatEx )

at Aspose.Slides.Pptx.TextCharacterPropertiesEx.(TextCharacterPropertiesEx )

at Aspose.Slides.Pptx.ParagraphPropertiesEx.(ParagraphPropertiesEx )

at Aspose.Slides.Pptx.ParagraphPropertiesEx..ctor(ParagraphPropertiesEx )

at Aspose.Slides.Pptx.ParagraphPropertiesEx.(ParagraphPropertiesEx )

at Aspose.Slides.Pptx.TextFrameEx.()

at Aspose.Slides.Pptx.TextFrameEx.get_()

at Aspose.Slides.Pptx.TextFrameEx.(Single , Single , ShapeStyleEx , TextFrameEx[] )

at Aspose.Slides.Pptx.AutoShapeEx.ProcessFitShapeToText()

at Aspose.Slides.Pptx.ShapeEx.PptxPrepareForSaving( saveContext)

at Aspose.Slides.Pptx.AutoShapeEx.PptxPrepareForSaving( saveContext)

at Aspose.Slides.Pptx.ShapesEx.( )

at Aspose.Slides.Pptx.GroupShapeEx.PptxPrepareForSaving( saveContext)

at Aspose.Slides.Pptx.BaseSlideEx.PptxPrepareForSaving( saveContext)

at Aspose.Slides.Pptx.SlideEx.PptxPrepareForSaving( saveContext)

at Aspose.Slides.Pptx.PresentationEx.(BaseSlideEx )

at Aspose.Slides.Pptx.SlidesEx.(SlideEx )

at Aspose.Slides.Pptx.SlidesEx.AddClone(SlideEx slide)

Hello Dear,

I have observed the stack trace but I am sorry that without source presentation and the code snippet that you are using, it is difficult to reproduce the issue for resolution. Moreover, I have observed that you are using Aspose.Slides for .NET 4.4.10.1 version which is fairly old. I would recommend to please try using latest available Aspose.Slides for .NET 5.3.0 and if the problem still persists then please share the requested data for necessary investigation on our end.

Thanks and Regards,

Mudassir –

Thank you, I have tried in 5.3 as well… attached is a sample project and presentation created with standard PowerPoint 2007.

The problem presents anytime there is more than one thread accessing the PresentationEx.Save method and usually presents at the GradientFormatEx or GradientEx as in the stack trace above.

The example provided always throws one of 3 errors (at least on my machine) usually in GradientFormatEx or GradientEx, all of them fatal . They all seem to be issues with concurrency – more information is contained in the comments in the code sample provided.

The only requirement is that this be run on a multi-core computer, otherwise the Parallel class will revert to single threading and you will not see the issue.

Thank you
Chadwick

Hi Chadwick,

Thanks for sharing the desired information. An issue with ID 29586 has been created in our issue tracking system to further investigate and resolve the issue on our. I will share the further information with you after the issue is scheduled and verified by our developmen team.

We are sorry for your inconvenience,

Hi Chadwick,

Our development team has investigated the issue on CoreI7 mobile using Aspose.Slides for .NET 5.3.0. Can you please share the hardware and software environment details with us for further investigation.

Thanks and Regards,