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

Free Support Forum - aspose.com

Some docx files are not processing with exception "System.InvalidCastException"

We have few documents (attached) which could not be opened by Aspose API and we get an exception.


<div style=“box-sizing: border-box; color: rgb(34, 34, 34); font-family: “Segoe UI”, “Helvetica Neue”, Helvetica, Arial, Verdana; font-size: 12px; background-color: rgb(255, 255, 255);”>Exception thrown: ‘System.InvalidCastException’ in Aspose.Words.dll
<div style=“box-sizing: border-box; color: rgb(34, 34, 34); font-family: “Segoe UI”, “Helvetica Neue”, Helvetica, Arial, Verdana; font-size: 12px; background-color: rgb(255, 255, 255);”>

Additional information: Unable to cast object of type ‘Aspose.Words.Markup.StructuredDocumentTag’ to type ‘Aspose.Words.Paragraph’. (Also see attached screenshot)

{
“Depth”: 1,
“ClassName”: “System.InvalidCastException”,
“Message”: “Unable to cast object of type ‘Aspose.Words.Markup.StructuredDocumentTag’ to type ‘Aspose.Words.Paragraph’.”,
“Source”: “Aspose.Words”,
“StackTraceString”: " at Aspose.Words.Document.\u0003(Stream \u0002, LoadOptions \u0003)\r\n at Aspose.Words.Document.\u0002(Stream \u0002, LoadOptions \u0003)\r\n at Rrd.ActiveDocument.DocumentProcessing.Services.WordDocumentPreprocessor.AcceptAllRevisions(Stream openXmlStream) in C:\vNextAgents\Agent_02\_work\19\s\Backend\Core\Rrd.ActiveDocument.DocumentProcessing\Services\WordDocumentPreprocessor.cs:line 123\r\n at Rrd.ActiveDocument.DocumentProcessing.Services.WordDocumentPreprocessor.ProcessDocument(IBlobData rawData) in C:\vNextAgents\Agent_02\_work\19\s\Backend\Core\Rrd.ActiveDocument.DocumentProcessing\Services\WordDocumentPreprocessor.cs:line 85",
“RemoteStackTraceString”: null,
“RemoteStackIndex”: 0,
“ExceptionMethod”: {
“Name”: “\u0003”,
“AssemblyName”: “Aspose.Words”,
“AssemblyVersion”: “17.2.0.0”,
“AssemblyCulture”: “”,
“ClassName”: “Aspose.Words.Document”,
“Signature”: “Void \u0003(System.IO.Stream, Aspose.Words.LoadOptions)”,
“MemberType”: 8
},
“HResult”: -2147467262,
“HelpURL”: null
}

Please take a look what is wrong.


Hi Vladyslav,


Thanks for your inquiry. We have tested the scenario using Aspose.Words for .NET 17.4 and unable to notice the reported issue. Your shared DOCX files are being loaded successfully in Aspose.Words. Please download and try latest version of Aspose.Words, it will resolve the issue. However if the issue persists then please share your sample code here, we will further look into the issue and will guide you accordingly.

Best Regards,

Hi Tilal,


Sorry, by mistake we uploaded non-modified documents which are really processed without errors.
I attached the documents which can be used to reproduce the issue.
Could you please try them and let us know if you are able to catch the exception?

Thanks in advance!

Hi Vladyslav,


Thanks for your feedback. We have tested the scenario with your shared documents and noticed the reported issue. We have logged following issues against the documents in our issue tracking system for further investigation and rectification. we will notify you as soon as these issues are resolved.

WORDSNET-15210: Document loading exception(NCMI_Master.zip.docx)
WORDSNET-15211: Document loading exception(Active link Exhibit 99.1.zip.docx)
WORDSNET-15212: Document loading exception(LMFA_Master.zip.docx)

We are sorry for the inconvenience.

Best Regards,

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


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

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


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