Hi,
I’ve attached a solution with two C# projects which include a SampleDoc.docx which causes a ‘document corrupt’ exception in Aspose.Words.dll version 15.11.0 but not in 15.7.0 (the same document) when loaded.
The ‘DocumentCorrupt’ project uses Aspose.Words.dll version 15.11.0.0
The ‘DocumentOK’ project uses Aspose.Words.dll version 15.7.0.0
I tried several versions after 15.7.0 including the latest but the problem persists. Interestingly if I open the document in Word, make a small change (e.g. add a space) and then save, the problem goes away. (I can’t do this in our application though as Word isn’t installed on the server where it runs, and the docx is dynamically generated using OpenXML.)
I’ve been forced to downgrade our application to the 15.7.0.0 version until this can be fixed.
Thanks
Paul
The stack trace is;
Aspose.Words.FileCorruptedException: The document appears to be corrupted and cannot be loaded. —> System.NullReferenceException: Object reference not set to an instance of an object.
at ? . (Table )
at ? (Table )
at ? . (Table )
at ? …ctor(Table , Boolean )
at ? .(Table , Boolean )
at ☼ .(Table , Stack , Boolean )
at ☼ .VisitTableEnd(Table )
at Aspose.Words.Tables.Table.r3ka8zscesabkstb24kjjv9sml9wq7pw? (DocumentVisitor )
at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
at Aspose.Words.Tables.Table.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
at Aspose.Words.Body.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
at Aspose.Words.Section.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
at Aspose.Words.Document.Accept(DocumentVisitor visitor)
at ☼ .(Document , LoadOptions )
at Aspose.Words.Document.(Stream , LoadOptions )
— End of inner exception stack trace —
at Aspose.Words.Document.(Stream , LoadOptions )
at Aspose.Words.Document.(Stream , LoadOptions )
at Aspose.Words.Document…ctor(String fileName, LoadOptions loadOptions)
at Aspose.Words.Document…ctor(String fileName)
at DocumentCorrupt.Program.Main(String[] args) in c:\Users\paul.green\Visual Studio 2015\Projects\AsposeWordsNullRefBug\DocumentCorrupt\Program.cs:line 15