First of all, we haven’t found a way to replicate this consistently.
I’m working on this to give you as much context as possible, I will update the thread, in the meantime I would like to know what you think about that.
We suspect a race condition in the Presentation.Save method. We were able to observe this issue more than one time. Here is the exception stack trace:
ERROR: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Collections.Generic.List`1.Enumerator.MoveNext()
at Aspose.Slides.   .(String , ​   , Int32 , Single , FontStyle , Boolean )
at Aspose.Slides.   .(String , ​   , Int32 , Single , FontStyle , Boolean )
at Aspose.Slides.   .(String , ​   , Int32 , Single , FontStyle , Boolean )
at Aspose.Slides.   .(Single )
at Aspose.Slides.   .(Int32 ,     )
at Aspose.Slides.   .()
at Aspose.Slides.   ..ctor(TextFrame , Single , Single , IBaseSlide ,     )
at Aspose.Slides.TextFrame.(Single , Single , IShapeStyle ,     )
at Aspose.Slides.TextFrame.(ShapeFrame& , RectangleF& , Single& , Single& , Single& , Single& ,     )
at Aspose.Slides.   .(IAutoShape ,     ,     ,     )
at Aspose.Slides.   .(IShape ,     ,     ,     )
at Aspose.Slides.   .(IGroupShape ,     ,     ,     )
at Aspose.Slides.â€â€‡â€†.(IBaseSlide ,     ,     )
at Aspose.Slides.   .(IMasterSlide , Boolean )
at Aspose.Slides.   .(    , IMasterSlide , Boolean ,     )
at Aspose.Slides.   .(IPresentation , Stream , PresentationTypeEx , IPptxOptions , InterruptionToken )
at Aspose.Slides.Presentation.(Stream , PresentationTypeEx , IPptxOptions )
at Aspose.Slides.Presentation.Save(Stream stream, SaveFormat format, ISaveOptions options)
Our code looks like this:
using (MemoryStream memStream = new MemoryStream())
{
// Save a presentation to stream, the exception is raised in the next line
Presentation.Save(memStream, Aspose.Slides.Export.SaveFormat.Pptm);
memStream.Position = 0;
// create a new presentation starting from the stream
Aspose.Slides.LoadOptions LoadOpt = new Aspose.Slides.LoadOptions(Aspose.Slides.LoadFormat.Auto);
Aspose.Slides.Presentation ClonedPpt = new Aspose.Slides.Presentation(memStream, LoadOpt);
}