Aspose.Word .Net 21.6 throw "Unable to cast object of type" when loading the doc file

Hi,
We’re using Aspose.Word .NET 21.6 to loading the DOC file. But when loading the attached file, an exception with the message “Unable to cast object of type '\u000e ​ ’ to type '\u0003 ​ '.” was thrown.
Code:

try
{
    var doc = new Aspose.Words.Document("sample.doc");
}
catch (Exception e)
{
    Console.WriteLine(e.Message);
}
Console.WriteLine("Done");

Sample file: sample.zip (13.3 KB)

@dunghnguyen,

You’re right; Aspose.Words for .NET currently throws following exception upon loading this particular Word DOC document.

System.InvalidCastException
  HResult=0x80004002
  Message=Unable to cast object of type ' ​ ' to type ' ​ '.
  Source=Aspose.Words

We have logged this problem in our issue tracking system with ID WORDSNET-22389. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

Thank you for your quick response.

1 Like

Hi @awais.hafeez,
Is there any updates on this issue?
Thank you

@dunghnguyen,

We have included the fix of this issue (WORDSNET-22389) in 21.7 version of Aspose.Words for .NET API (see release notes). So, we suggest you to please upgrade to the latest version.

The issues you have found earlier (filed as WORDSNET-22389) have been fixed in this Aspose.Words for .NET 21.7 update and this Aspose.Words for Java 21.7 update.