Free Support Forum - groupdocs.com

Document comparison throws exception in .NET

Comparison from StartState_Cleaned.docx with EndState_Cleaned.docx gives exception. (In the zip file)
The problem is not symmetrical (end compared to start doesnt throw). Updating to latest version of Aspose does not help.

Error occurred in comparing Word documents
GroupDocs.Comparison
at .( [] , [] , CompareOptions , )
at . ( , CompareOptions , SaveOptions )
at GroupDocs.Comparison.Comparer.(Document , Document , CompareOptions , SaveOptions , )
at GroupDocs.Comparison.Comparer.Compare(Stream document, SaveOptions saveOptions, CompareOptions compareOptions)
at GroupDocs.Comparison.Comparer.Compare(Stream document, CompareOptions compareOptions)
at Canea.Common.DocumentFormat.Standard.DocumentContentComparer.Compare(NamedFileDataStream oldestDoc, NamedFileDataStream newestDoc) in C:\CANEA.NET\Framework\dev\Common\Common.DocumentFormat.Standard\DocumentContentComparer.cs:line 42
at Canea.Framework.BLL.Docpoint.Document.DocpointDocumentComparisonHandler.RunComparison(NamedFileDataStream oldestDocument, NamedFileDataStream newestDocument) in C:\CANEA.NET\Framework\dev\Lib\FrameworkLib\BLL\Docpoint\Document\DocpointDocumentComparisonHandler.cs:line 187

compare options:
DetectStyleChanges = false, GenerateSummaryPage = false
(HeaderFootersComparison = false has no effect on this bug)

usage:
using (var comparisonService = new Comparer(oldDoc.DataStream))
{
comparisonService.Add(newDoc.DataStream);
Stream result = new MemoryStream();
comparisonService.Compare(result, CompareOptions);
}

Aspose.PDF 19.9.0
Aspose.Words 19.10.0
(Aspose.Calc 19.10.0)

the2filesforreproduction.zip (60.4 KB)

1 Like

(Just for internal reference, this is bug 16197)

@lars.olsson,

Could you please also specify GroupDocs.Comparison for .NET version (e.g. 19.10, 20.4) that you integrated in the application?

GroupDocs.Comparison 20.1.0 (doesnt work on 20.4.2 either)

1 Like

@lars.olsson,

We cannot reproduce this issue using version 20.4.2. Please have a look at this output - output.zip (34.3 KB). Can you please share a simple console application using that issue could be reproduced.

Ill look in to this during the day and get back with more data.
I’ll probably not write a simple console application for you however, since your online tool seems to reproduce this issue also: https://products.groupdocs.app/comparison/f062bb48-9ec3-4edb-a50c-b5a61f5203d5/StartState_Cleaned.docx/EndState_Cleaned.docx/
image.png (30.0 KB)

Based on your result file in output.zip, you have reversed the order. (Comparing end to start instead of start to end, since text in start is blue/added but should be red/deleted).

1 Like

@lars.olsson,

In this case, we can reproduce the issue. We’ve logged it in our internal issue tracking system with ID COMPARISONNET-2325 for further investigation. As there’s any update, you’ll be notified.