We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

IComparer.Compare() exception


I have a problem with the Aspose.Words.DocumentBuilder class, maybe you can help me out. If I create a specific instance of DocumentBuilder and then try to save it into a PDF file, I get an ArgumentException error with the following message:

Unable to sort because the IComparer.Compare() method returns inconsistent results. Either a value does not compare equal to itself, or one value repeatedly compared to another value yields different results. IComparer: 'System.Collections.Comparer'.

This problem only arises when I am using .Net Framework 4.5. On version 4.0 (or lower) it works without problems.

I attached the excact source code and a screenshot with the ArgumentException message.

I use the latest Aspose.Words for.NET 2.0, file version, product version 2014.01.31. Thank you in advance for your help.


Hi Boris,

Thanks for your inquiry. Please attach your input Word document you’re getting this problem with here for testing. Also, to ensure a timely and accurate response, it would be great if you please create a standalone runnable simple console application that helps us reproduce your problem on our end and attach it here for testing. As soon as you get this simple application ready, we’ll start investigation into your issue and provide you more information.

Best regards,


I attached a sample project. Just run it and you will see that it crashes at the end of Export procedure in Exporter class. Let me know if you need anything else. As I said: it works if the application is built for .Net 4.0 framework, but it doesn’t work if built for .Net 4.5. Regards,

Boris Turk

Hi Boris,

Thanks for your inquiry. I tested the scenario and have managed to reproduce the same problem on my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-9816. Our development team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-9816) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.