Aspose.Words .NET with Mono corruption message?

Hi,

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.

`  `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]
`  `at Hello.Main () [0x00000]

Thanks,

Mark.

Hi
Thanks for your inquiry. May be there is something wrong with your document. Could you please attach this document for testing?
Best regards.

Hi,

The same document worked fine with Aspose.Words for Java. Here it is.

Regards,

Mark

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.

Hi,

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.

Regards,
Mark.

Compiling using:
gmcs test.cs /r:System.Windows.Forms.dll /r:Aspose.Words.dll
Running as:
mono test.exe

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:

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] 
`  `at Hello.Main () [0x00000] 

/Mark

Hi,

Found a solution to the problem: use mcs and the net1.1 libraries instead of gmcs and net2.0. Works perfectly!

Are there any disadvantages to using the 1.1 libraries over the 2.0 ones?

Regards,
Mark.

Hi
It is nice that you already found solution. No there is no functionality differences between 1.1 and 2.0 versions of library.
Best regards.

I got the same problem. Using mono net-1.1 is no solution for me as my visitor depends on net-2.0.

Is there any new information on that topic?

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.

I can reproduce that problem on a linux server machine:

Linux host 2.6.16-xen #2 SMP Sun Jul 9 15:43:58 CEST 2006 i686 GNU/Linux

Mono JIT compiler version 1.9.1 (tarball)

Copyright © 2002-2007 Novell, Inc and Contributors. www.mono-project.com

TLS: __thread

GC: Included Boehm (with typed GC)

SIGSEGV: altstack

Notifications: epoll

Architecture: x86

Disabled: none

And on my MacBook:

Darwin Ernst 9.5.0 Darwin Kernel Version 9.5.0: Wed Sep 3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386 i386

Mono JIT compiler version 2.0.1 (tarball)

Copyright © 2002-2008 Novell, Inc and Contributors. www.mono-project.com

TLS: normal

GC: Included Boehm (with typed GC)

SIGSEGV: normal

Notification: Thread + polling

Architecture: x86

Disabled: none

Exception:

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]

(And I use the latest version of Aspose.Words)

Hi
Thank you for more information. We will investigate the problem and provide you more information.
Best regards.

Hi

i have got the same problem like Wanderer!
Would love to hear any news about this problem!

thank you
J.

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.

Thank you

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.

Still got the same problem using Aspose.Words 6.0.0. Are you able to reproduce the problem? Do you need more details?