Avoid File Corrupted Exception when Loading DOCX with Comment Paragraphs with Duplicate ParaIds | C# .NET

Hi,

We are encountering an exception when loading these set of documents using Aspose.Words v20.8.0 stating that the files appears to be corrupted. However, when the documents are opened using MS Word, there are no hints of document corruption.

Here is the code snippet and exception details:

try
{
    Document document = new Document(filePath);
}
catch (FileCorruptedException fce)
{ }
    Aspose.Words.FileCorruptedException: The document appears to be corrupted and cannot be loaded. ---> System.InvalidOperationException: A value with the specified key has already been added.
       at   . (Int32 ,  , Boolean )
       at ?  .(?   , Paragraph )
       at ?  .?    (?   )
       at    .     (?   )
       at    .     (?   )
       at ?  .(CompositeNode )
       at    .(?   )
       at ?  .()
       at ?  .()
       at ?  .()
       at Aspose.Words.Document.(Stream , LoadOptions )
       --- End of inner exception stack trace ---
       at Aspose.Words.Document.(Stream , LoadOptions )
       at Aspose.Words.Document.(Stream , LoadOptions )
       at Aspose.Words.Document..ctor(String fileName, LoadOptions loadOptions)

Can you please look into this and share your findings?
Set4 (17.4 KB)
Set5.docx (17.4 KB)
Set7.docx (17.5 KB)

Cheers

@dcdeveloper,

We tested the scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-22313. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

Thank you for looking into this, is there any updates on this issue?
Cheers

@dcdeveloper,

Unfortunately, WORDSNET-22313 is not resolved yet. We have implemented a fix for WORDSNET-22313; but currently we are reviewing/testing all the code changes that were made in the scope of this issue. We will inform you via this thread as soon as your issue will get resolved in future. We apologize for any inconvenience.

The issues you have found earlier (filed as WORDSNET-22313) have been fixed in this Aspose.Words for .NET 21.8 update and this Aspose.Words for Java 21.8 update.