Pdf load exception

Hello :slight_smile:

Dim MyDocument As Words.Document = New Words.Document(pdfFile, New Words.Loading.PdfLoadOptions)

A first chance exception of type ‘System.TypeInitializationException’ occurred in Aspose.Words.dll

The type initializer for ' ’ threw an exception.

System.TypeInitializationException: The type initializer for ' ’ threw an exception. —> System.NullReferenceException: Object reference not set to an instance of an object.

at  …cctor()

— End of inner exception stack trace —

at  …ctor( )

at  …ctor( )

at  …ctor( )

at  .()

at  …ctor(ICollection`1 ,  )

at  .( ,  )

at  .( )

at  .(Action`1 )

at  …cctor()

@australian.dev.nerds Could you please attach the problematic input document here for testing? Which version of Aspose.Words do you use?

1 Like

Hello and thanks for your attention, I tried few pdf files, latest 26.7 tested, will upload that pdf :slight_smile:

Hello, this happens only when I run the app from within Visual Studio, if I compile and run the .exe no exception is thrown!

Using Visual Studio .net 2013 Pro, sample project is in vb.net 4.8 WinForms!

When loaded the project in Visual Studio .net 2019 Pro, no exception!

Seems you don’t like 2013 vshost :smiley:
Thanks.