Free Support Forum -

Invalid Operation error while cloning slides

Getting this error while trying to add clone slide :

Presentation master= new Presentation(this.getClass().getClassLoader().getResourceAsStream("src/main/resources/slide.pptx"));

Presentation presentation = new Presentation(); 

I am passing the master slide to several methods and executing those methods in parallel. I don’t get any issue when executing them sequentially.
com.aspose.slides.exceptions.InvalidOperationException: Trying to add new cached value with the same keys.


There is issue in your used code. You are cloning the master slide in normal slide with is not right. You need to use the correct slide type for cloning is respecting collection.

Thanks. I was able to figure out the issue.


It’s good to know things are working fine on your end as per suggestion.