exception: Object reference not set to an instance of an object

Apr 30, 2009 at 2:14 PM
Edited Apr 30, 2009 at 2:15 PM

Hi,
I'm using win7 build 7100 (RC) with office 2007 SP1. Whenever I drop a file to the monitored XPS2ONENOTE folder I get this error message...
Any ideas?
Alexander



See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Office.OneNote.Page.SerializeToXml(XmlNode parentNode)
   at Microsoft.Office.OneNote.Page.ToString()
   at Microsoft.Office.OneNote.Page.Commit()
   at XPS2OneNote.OneNoteHelper.InsertXPSPagesInSection(String xpsFilePath, String sectionFilePath, Double scalePercent, ProgressDelegate reportProgress)
   at XPS2OneNote.PrintForm.insertXPSButton_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4918 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
XPS2OneNote
    Assembly Version: 1.0.3395.37565
    Win32 Version: 1.0.3395.37565
    CodeBase: file:///C:/Program%20Files%20(x86)/CodePlex/XPS2OneNote/XPS2OneNote.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4918 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4918 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4918 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4918 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4918 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Core
    Assembly Version: 3.5.0.0
    Win32 Version: 3.5.30729.4918 built by: NetFXw7
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
Microsoft.Office.Interop.OneNote
    Assembly Version: 12.0.0.0
    Win32 Version: 12.0.4518.1014
    CodeBase: file:///C:/Windows/assembly/GAC/Microsoft.Office.Interop.OneNote/12.0.0.0__71e9bce111e9429c/Microsoft.Office.Interop.OneNote.dll
----------------------------------------
System.Xml.Linq
    Assembly Version: 3.5.0.0
    Win32 Version: 3.5.30729.4918 built by: NetFXw7
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml.Linq/3.5.0.0__b77a5c561934e089/System.Xml.Linq.dll
----------------------------------------
ReachFramework
    Assembly Version: 3.0.0.0
    Win32 Version: 3.0.6920.4900 built by: NetFXw7
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/ReachFramework/3.0.0.0__31bf3856ad364e35/ReachFramework.dll
----------------------------------------
OneNoteImporter
    Assembly Version: 11.0.0.0
    Win32 Version: 11.0.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/CodePlex/XPS2OneNote/OneNoteImporter.DLL
----------------------------------------
WindowsBase
    Assembly Version: 3.0.0.0
    Win32 Version: 3.0.6920.4900 built by: NetFXw7
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/WindowsBase/3.0.0.0__31bf3856ad364e35/WindowsBase.dll
----------------------------------------
PresentationFramework
    Assembly Version: 3.0.0.0
    Win32 Version: 3.0.6920.4900 built by: NetFXw7
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/PresentationFramework/3.0.0.0__31bf3856ad364e35/PresentationFramework.dll
----------------------------------------
PresentationCore
    Assembly Version: 3.0.0.0
    Win32 Version: 3.0.6920.4900 built by: NetFXw7
    CodeBase: file:///C:/Windows/assembly/GAC_64/PresentationCore/3.0.0.0__31bf3856ad364e35/PresentationCore.dll
----------------------------------------
System.Data
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4918 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_64/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

May 15, 2009 at 11:30 PM

Yep - I see exactly the same error.

When you ran it for the first time did you get a "type initalizer for XPS2OneNote.OneNoteHelper threw an exceptoin" error?

I'd be happy to debug if source code was posted!!!

May 20, 2009 at 5:04 PM

I have windows 7 build 7100 and get:

1 /"had an error in file change handler..The type initializer for XPS2OneNote.OneNoteHelper threw an exception. " also the first time. It doesn't launch the "Print to OneNote" windows from xps2onenote

2 / Killing xps2onenote and launching it again, it goes one step further. It shows the "Print to OneNote" and ask where to insert the Printout.
I then get this .net error:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Office.OneNote.Page.SerializeToXml(XmlNode parentNode)
   at Microsoft.Office.OneNote.Page.ToString()
   at Microsoft.Office.OneNote.Page.Commit()
   at XPS2OneNote.OneNoteHelper.InsertXPSPagesInSection(String xpsFilePath, String sectionFilePath, Double scalePercent, ProgressDelegate reportProgress)
   at XPS2OneNote.PrintForm.insertXPSButton_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
...

 



Jun 9, 2009 at 3:58 AM

I get the same error after selecting the OneNote folder to print/transfer into. I ryn Win7. Any idea how to fix it?

Jun 30, 2009 at 5:55 AM

Just wanted to add that I also am getting the same error on Windows 7 Build 7100. Any chance of this getting fixed?

Jun 30, 2009 at 6:44 AM

Or even uploading the source code - I'd be happy to run the debugger on it and see if I can spot the source of the problem as it is 100% repro on my system.

Jul 9, 2009 at 2:17 AM

I'm getting the same "type initializer (blah blah blah) threw an exception" error and it doesn't launch "print to onenote."  I am not brainy enough to debug - should I just uninstall the whole thing?  I *so* wanted this to work... :(  Thank you so much for your time and help, anyway!!

Aug 28, 2009 at 4:28 PM

I have the same problem.  I downloaded the .Net SDK and edited the machine.config file and added the jitDebugging = True code.  I actually have 2 machine.config files, one in an x64 .Net CONFIG folder and one in an x86 .Net CONFIG folder, I edited both, but it made no difference.

Sep 9, 2009 at 7:40 PM

i want to say that i got the same problem and i'm on Vista 64 bit.  that was when i had more than one instance running, indicated by more than one icon in the tray.  when i exited out of two, expecting one to be left running, nothing happened, no error, but no nothing at all