ASPOSE.words unhandled exception

The following line of code causes the application to hang when opening a docx document that is corrupt.

Dim _Document = New Aspose.Words.Document(FilePath, attloadOptions)

The expectation is this should throw an error not hang the entire application indefinity.

is this a known bug? how do we work around this issue?

@smorrison21d1b Could you please attach the problematic document here for testing? We will check the issue and provide you more information. Unfortunately, without the document we cannot tell what the problem is.

document attached.
test.docx (15.7 KB)

@smorrison21d1b I cannot reproduce the problem on my side using the latest 24.3 version of Aspose.Words.
The following code throws FileCorruptedException exception, just as expected:

Document doc = new Document(@"C:\Temp\in.docx");

I have this code in a try block that catches exceptions and all the application does is hang. The exception is never triggered.

@smorrison21d1b Which version of Aspose.Words do you use? have you tried using the latest 24.3 version?

we are using version 24.3

@smorrison21d1b Could you please create a simple console application that will allow us to reproduce the problem? We will check it and provide you more information

I have found the issue.

I am setting up the loadoptions configuration to format .docx because that is the file type using the code below:

Dim attloadOptions = New Aspose.Words.Loading.LoadOptions()
attloadOptions.LoadFormat = Aspose.Words.LoadFormat.Docx

This results in the application hanging indefinitely.

However when I change this to

Dim attloadOptions = New Aspose.Words.Loading.LoadOptions()
attloadOptions.LoadFormat = Aspose.Words.LoadFormat.Auto

the application no longer hangs and generates an exception.

question: Should we not be setting this option?

@smorrison21d1b

You normally should not specify load format. Aspose.Words automatically detects file format.