Dear Aspose support team,
we use .NET Aspose.Words v25.9.0 and ran into System.InvalidOperationException : "Cannot find a style with this istd"
Error while using the Document.AppendDocument() function and thus seek your help.
The error is invoked when trying to append sample_file.docx
three times.
Appending the document once or twice, works fine.
NOTE: previously we did not use the same document three times but very similar ones to invoke the error.
In the attachment you’ll find a XUnit project to reproduce the issue.
Error Log:
Message:
System.InvalidOperationException : Cannot find a style with this istd.
Stack Trace:
StyleCollection.n(Int32 d, Int32 v)
Style.z()
Style.d(Style d, Ig v)
Style.Equals(Style style)
StyleCollection.m(Style d)
StyleCollection.c(eU7 d, Style v)
StyleCollection.d(eU7 d, Style v)
NodeImporter.d(PA d, PA v, Int32 c)
NodeImporter.d(Paragraph d, Paragraph v)
NodeImporter.d(Node d, Node v)
NodeImporter.v(Node d, Boolean v, j9 c)
NodeImporter.d(CompositeNode d, CompositeNode v, j9 c)
NodeImporter.v(Node d, Boolean v, j9 c)
NodeImporter.d(CompositeNode d, CompositeNode v, j9 c)
NodeImporter.v(Node d, Boolean v, j9 c)
NodeImporter.d(CompositeNode d, CompositeNode v, j9 c)
NodeImporter.v(Node d, Boolean v, j9 c)
NodeImporter.d(CompositeNode d, CompositeNode v, j9 c)
NodeImporter.v(Node d, Boolean v, j9 c)
NodeImporter.d(CompositeNode d, CompositeNode v, j9 c)
NodeImporter.v(Node d, Boolean v, j9 c)
NodeImporter.d(CompositeNode d, CompositeNode v, j9 c)
NodeImporter.v(Node d, Boolean v, j9 c)
NodeImporter.d(CompositeNode d, CompositeNode v, j9 c)
NodeImporter.v(Node d, Boolean v, j9 c)
NodeImporter.d(Node d, Boolean v, j9 c)
E9.v(Document d, ImportFormatMode v, ImportFormatOptions c)
Document.AppendDocument(Document srcDoc, ImportFormatMode importFormatMode, ImportFormatOptions importFormatOptions)
Document.AppendDocument(Document srcDoc, ImportFormatMode importFormatMode)
UnitTest1.AppendDocuments(IList`1 src_file_paths, ImportFormatMode import_format_mode) line 34
UnitTest1.AppendingDocuments_Fails(ImportFormatMode import_format_mode) line 22
InvokeStub_UnitTest1.AppendingDocuments_Fails(Object, Span`1)
MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
Best regards
sample_result.docx (14.3 KB)
AsposeIssuePOC.7z (18.3 KB)