Unhandled exception

Sep 8, 2008 at 11:49 AM
FYI:  Hi and thanks for sharing the code.  I created the files as specified but when i went to map the fields (Windows Vista) i got the following error:

"

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

************** Exception Text **************
System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
   at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.XmlTextReader.Read()
   at Migration_Tool.Form2..ctor(String fileCSVFile, String fileXMLFile, String saveFolder)
   at Migration_Tool.formImportStart.buttonMapFields_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.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.OnMessage(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.312 (rtmLHS.050727-3100)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Migration Tool
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/David%20Rose/Documents/MAVERIC/2007/Code/CSV%20to%20IP%20migration%20tool/Migration_Tool.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.312 (rtmLHS.050727-3100)
    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.312 (rtmLHS.050727-3100)
    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.312 (rtmLHS.050727-3100)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.312 (rtmLHS.050727-3100)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.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.
"

Coordinator
Oct 13, 2008 at 4:40 PM
Sorry for the delay in replying to you.  I forgot to turn on email notifications for new postings, so didn't notice your message until just recently.
I've been trying to reproduce the error you saw, and think I might know what happened.
Check that the Infopath file you're using is a document created with your Infopath template, and not the template file itself.  It should have an .XML extension, not an .XSN extension.

You can also check by opening the file with Notepad.  If you see a bunch of binary characters, you have the wrong file.  You should see a text file with XML tags, something like this: 

<?xml version="1.0" encoding="utf-8"?>
<?mso-infoPathSolution name="urn:schemas-microsoft-com:office:infopath:Interfaces:-myXSD-2007-11-26T20-35-56" solutionVersion="1.0.0.35" productVersion="12.0.0.0" PIVersion="1.0.0.0" href="http://server/Interfaces/Forms/template.xsn"?>
<?mso-application progid="InfoPath.Document" versionProgid="InfoPath.Document.2"?>
<?mso-infoPath-file-attachment-present?>
....etc, etc.

In the next version, I'm going to add some better error handling so that errors don't just bomb out but give you some idea of what went wrong.
Hope this helps.
Oct 13, 2008 at 4:54 PM

Nice of you to take the time to reply.  I’ll give it a look.

Thanks.

dave

From: akennel [mailto:notifications@codeplex.com]
Sent: Monday, October 13, 2008 12:41 PM
To: Rose, David M
Subject: Re: Unhandled exception [csvtoinfopath:35146]

From: akennel

Sorry for the delay in replying to you. I forgot to turn on email notifications for new postings, so didn't notice your message until just recently.
I've been trying to reproduce the error you saw, and think I might know what happened.
Check that the Infopath file you're using is a document created with your Infopath template, and not the template file itself. It should have an .XML extension, not an .XSN extension.

You can also check by opening the file with Notepad. If you see a bunch of binary characters, you have the wrong file. You should see a text file with XML tags, something like this:


<?mso-infoPathSolution name="urn:schemas-microsoft-com:office:infopath:Interfaces:-myXSD-2007-11-26T20-35-56" solutionVersion="1.0.0.35" productVersion="12.0.0.0" PIVersion="1.0.0.0" href="http://server/Interfaces/Forms/template.xsn"?>


....etc, etc.

In the next version, I'm going to add some better error handling so that errors don't just bomb out but give you some idea of what went wrong.
Hope this helps.

Read the full discussion online.

To add a post to this discussion, reply to this email (csvtoinfopath@discussions.codeplex.com)

To start a new discussion for this project, email csvtoinfopath@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com