Hi Aspose team,
if I run processing of OneNote documents in multithread mode (each document is separate thread) some of documents (randomly) get corrupted as during save of document exception: “An item with the same key has already been added” is happening.
From stack file I see:
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
2.Insert(TKey key, TValue value, Boolean add) at Aspose.Note.Fonts.FontsSubsystem.GetFontFamily(String fontName) at .(String , Single , FontStyle , ) at .() at .(Char ) at .(String ) at .(String , Single , TextStyle , IList1 , HorizontalAlignment , Single , )
at Aspose.Note.RichText.(Single )
at Aspose.Note.RichText.6vw7a38rx8hq7gf3sc2fzmpqyry3cca8 (SizeF )
1.6vw7a38rx8hq7gf3sc2fzmpqyry3cca8 (SizeF ) at Aspose.Note.CompositeNode1.6vw7a38rx8hq7gf3sc2fzmpqyry3cca8 (SizeF )
at Aspose.Note.Outline.6vw7a38rx8hq7gf3sc2fzmpqyry3cca8 (SizeF )
at Aspose.Note.Page.6vw7a38rx8hq7gf3sc2fzmpqyry3cca8 (SizeF )
at . ()
at . ( )
at . ()
at .(Document )
at .(Document , Stream , OneSaveOptions )
at ..(Object )
at .[T](Document , SaveOptions , Action`1 )
at .(Document , Stream , SaveOptions )
at .(Document , String , SaveOptions )
at .(Document , String , SaveFormat )
at Aspose.Note.Document.Save(String fileName, SaveFormat format)
To recreate the problem please run attached project in debug mode as this is very you can easily see the problem.
If you let processing until the end you will see that some documents will be with 0 bytes.
OneNote.Bugs.MultiThread.DocCorruption.zip (4.0 MB)
As I tested with 50+ documents and they are bigger than 50MB I am uploading them to the Box:
Please copy documents to debug folder of the application and put them in Docs\OneNote.
Thanks in advance,