Method not found: 'System.Collections.IEnumerator Aspose.Words.CompositeNode.GetEnumerator()'


#1

Hello,

Our application uses both GroupDocs.Comparison and the Aspose suite. We recently had issues with GroupDocs.Comparison 18.7.1, comparing two very simple plain .docx files.

When running Comparer.Compare in our app, the resulting document looked exactly like the “target” argument, and thus showed no changes.

When trying the same files with a simple standalone app that only referenced GroupDocs.Comparison (not any Aspose lib), it worked fine.

Investigating further, we noted that CountOfErrors in the ICompareResult instance returned was == 1 in our app. Digging through the result object we found the error message in the title:

Method not found: ‘System.Collections.IEnumerator Aspose.Words.CompositeNode.GetEnumerator()’.

Our app used GroupDocs.Comparison 18.7.1 and Aspose.Words 18.8.0. After upgrading GroupDocs.Comparison to 18.8.0, things worked fine again.

It’s not always possible for us to sync the versions of GD.C and A.W - if that somehow is an implicit requirement for running them both in the same app? What possibilities are there to run e.g. GD.C 18.7.1 and A.W 18.0.0 together?

The error reporting in Comparer.Compare is also quite lackluster - I personally would have expected the above to generate an exception, or that ICompareResult had an accessible property with error information. Now there’s only an error count, but no actual error information. Or am I missing something there?


#2

@lars.olsson,

Thank you for your inquiry.
In order to further investigate this issue at our end, we need a simple project or code sample (that implements both APIs) using that issue could be reproduced.

You can integrate different versions of two different APIs.

No, there is no such requirement. You don’t necessarily have to sync the versions.

You can run them together. But we have to investigate the issue you are facing. For that, please share a simple project with both APIs implemented.


#3

Hello again,

Attached is a sample program that reproduces our problem.

Debugging and inspecting the result object gives indication of the error I described (see attached image). Also note that the output file does not display any differences between V1 and V2.

If I remove the NuGet reference to Aspose.Words, the program works as expected.

GroupDocsComparer.zip (39.5 KB)

DebugLocalsError.png (49.3 KB)


#4

@lars.olsson,

We investigated this scenario at our end.
When we refer both APIs (GroupDocs.Comparison18.7.1 and Aspose.Words 18.8.0) in a single project. There can be some run-time error messages.
As application depends on Aspose.Words v18.8 and GroupDocs.Comparison v18.7.1 (see packages.config). Please note that GroupDocs.Comparison v18.7.1 depends on Aspose.Words v18.7.0.
Now, assembly binding configuration setting tells run-time to load Aspose.Words v18.8.0 into the process (see app.config).
When running the application run-time loads Aspose.Words v18.8.0 into the process and GroupDocs.Comparison v18.7.1 uses this assembly. Error message appears because GroupDocs.Comparison v18.7.1 depends on v18.7.0 API which is different in v18.8.0.

The best approach is to always use latest version of GroupDocs.Comparison for .NET. As latest version of GroupDocs.Comparison for .NET is 18.8.0 and Aspose.Words for .NET is 18.9.0. Hence, GroupDocs.Comparison v18.8.0 will depend on Aspose.Words v18.8.0 (as 18.8.0 is previous version of Aspose.Words. Latest is 18.9.0).
Hope it will help. Please let us know if you have any further query.