I’m just trying to get a very simple test program running in the Mono environment and I am encountering an error message that I can’t make sense of. Firstly, I don’t have a valid license or even a trial license - but the program seems to run anyway. Can the errors be related to that?
The code I’m using is very simple:
using System;
using Aspose.Words;
class Hello {
static void Main() {
Console.WriteLine("Loading.");
Document doc = new Document(@"buggy3.doc");
Console.WriteLine("Saving HTML.");
doc.Save(@"buggy3.html", SaveFormat.Html);
}
}
And the error messagefrom Mono is:
Unhandled Exception: Aspose.Words.FileCorruptedException: The document appears to be corrupted and cannot be loaded. —> System.ArgumentException: Comparer threw an exception.
Hi
Thank you for additional information. Your document works fine on my side. Could you please provide me more information about your environment? (OS, version of Mono, version of Aspose.Words). I will try to reproduce the issue and provide you more information.
Best regards.
Thanks. I am running on Mac OS X 10.5, using the Mono Framework 2.0.4, compiling with the command line compiler gmcs. I am using the latest official release of Aspose.Words.
I have also just tested on a Gentoo distribution of Linux, running Mono 1.9.1, and encountered another error message, if this helps at all. Am I not installing Mono correctly?
Loading.
Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for ?.? ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.KnownColors ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: gdiplus.dll
` `at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
` `at System.Drawing.GDIPlus..cctor () [0x00000] --- End of inner exception stack trace ---
` `at System.Drawing.KnownColors..cctor () [0x00000] --- End of inner exception stack trace ---
` `at System.Drawing.Color.get_White () [0x00000]
` `at ?.?..cctor () [0x00000] --- End of inner exception stack trace ---
` `at Aspose.Words.Drawing.ShapeBase..ctor (Aspose.Words.Document doc) [0x00000]
` `at Aspose.Words.Drawing.Shape..ctor (Aspose.Words.Document doc) [0x00000]
` `at ?.?.? (?.? ?) [0x00000]
` `at ?.?.? (?.? ?) [0x00000]
` `at ?.?.? (System.IO.BinaryReader ?, Int32 ?, Int32 ?, System.IO.BinaryReader ?) [0x00000]
` `at ?.?.? () [0x00000]
` `at Aspose.Words.Document.? (System.IO.Stream ?, LoadFormat ?, System.String ?) [0x00000]
` `at Aspose.Words.Document..ctor (System.String fileName, LoadFormat loadFormat, System.String password) [0x00000]
` `at Aspose.Words.Document..ctor (System.String fileName) [0x00000]
` `at Hello.Main () [0x00000]
Hi,
Sorry to keep throwing error messages at you!
The previous Linux error message can be ignored, I hadn’t installed Mono correctly and libgdiplus was missing. However, upon fixing that I get the same error message as I do on Mac OS X:
Hi
Thanks for your inquiry. Which versions of mono and Aspose.Words are you using? Please provide me more information about your environment. I will try to reproduce the problem and provide you more information.
Best regards.
Unhandled Exception: Aspose.Words.FileCorruptedException: The document appears to be corrupted and cannot be loaded. —> System.ArgumentException: Comparer threw an exception.
at System.Collections.ArrayList.BinarySearch (System.Object value) [0x00000]
at ᧦..᳥ (Int32 ) [0x00000]
at ᦡ.ᦠ. (Int32 ) [0x00000]
at ᦡ.ⅿ.ஷ () [0x00000]
at ᦡ.ᦠ.ࠆ () [0x00000]
at Aspose.Words.Document.ࠛ (System.IO.Stream َ, LoadFormat ೡ, System.String ح) [0x00000] — End of inner exception stack trace —
at Aspose.Words.Document.ೢ (System.Exception ೣ) [0x00000]
at Aspose.Words.Document.ࠛ (System.IO.Stream َ, LoadFormat ೡ, System.String ح) [0x00000]
at Aspose.Words.Document…ctor (System.String fileName, LoadFormat loadFormat, System.String password) [0x00000]
at Aspose.Words.Document…ctor (System.String fileName) [0x00000]
Hi
Thanks for your inquiry. I managed to reproduce the problem on my side. We will investigate the issue further and provide you more information.
NOTE: Aspose.Words .NET1.1 assembly works fine with mcs compiler.
Best regards.
I’m glad we’re not the only ones having this problem. Everything works fine on Windows by the way. As I already stated I can’t use net-1.1 as the application relies on some net2.2 assemblies.
Hi
Thanks for your request. We will try to fix this problem before next release. Next release is planed on next Monday (24th of November).
Best regards.