This project has moved. For the latest updates, please go here.

System.NullReferenceException occurred in DocumentFormat.OpenXml.dll

Jun 30, 2014 at 10:48 PM
I am trying to use the source code but when running a simple test case it fails in HtmlConverter.cs line 89 in the if (mainPart.Document.Body == null)

A first chance exception of type 'System.NullReferenceException' occured in DocumentFormat.OpenXml.dll

Additional informatio: Object reference not set to an instance of an object.
If there is a handler for this exception, the program may be safely continued.

Does anyone get the same behaviour?
Coordinator
Jul 1, 2014 at 9:04 AM
I'm pretty sure the MainDocumentPart argument you pass in the constructor of HtmlConverter is null.
Because the Document and the Body is created on the fly if they don't exist.