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)
at System.Collections.Generic.Dictionary2.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 , IList
1 , HorizontalAlignment , Single , )
at Aspose.Note.RichText.(Single )
at Aspose.Note.RichText.6vw7a38rx8hq7gf3sc2fzmpqyry3cca8 (SizeF )
at Aspose.Note.CompositeNode1.6vw7a38rx8hq7gf3sc2fzmpqyry3cca8 (SizeF ) at Aspose.Note.CompositeNode
1.6vw7a38rx8hq7gf3sc2fzmpqyry3cca8 (SizeF )
at Aspose.Note.Outline.6vw7a38rx8hq7gf3sc2fzmpqyry3cca8 (SizeF )
at Aspose.Note.Page.6vw7a38rx8hq7gf3sc2fzmpqyry3cca8 (SizeF )
at Aspose.Note.Page.()
at Aspose.Note.Page.get_PageLayoutSize()
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.
Project:
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:
https://app.box.com/s/jppgqcioz0j7e1iaado3t6ehijqu85w2
Please copy documents to debug folder of the application and put them in Docs\OneNote.
Thanks in advance,
Oliver