Strategy Monitor Exception: error in XML document
Author: jeffjs2003
Creation Date: 10/2/2017 6:18 PM
profile picture


I was running my strategies today in real-time and my laptop powered down (battery drained) while the Strategy Monitor was open. After powering back up, I was able to re-start WLP but every time I attempted to open Strategy Monitor I'd get an Unhandled Exception error. This happens whether I'm logged in or out. I uninstalled the WLP version I had and installed 6.9.19. Same problem. I can open all my strategies and WLP windows but not Strategy Monitor. Below is the beginning of the error text. I can provide the complete text if that helps. Any idea on how to get Strategy Monitor back? Thanks.


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

************** Exception Text **************
System.InvalidOperationException: There is an error in XML document (0, 0). ---> System.Xml.XmlException: Root element is missing.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlReader.MoveToContent()
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderList1.Read12_ArrayOfStrategyCenterItem()
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at System.Xml.Serialization.XmlSerializer.Deserialize(TextReader textReader)
at WealthLabPro.StrategyCenterForm.c()
at WealthLabPro.MainForm.OpenStrategyCenter()
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
profile picture


Hi Jeff,

Reason: Strategy Monitor's config file got corrupt due to abnormal program termination.

Solution is pretty straightforward: delete the file gone bad.

For a how-to please refer to Knowledge Base > Errors section > Strategy Monitor doesn't work > where it says "There is an error in XML document (0, 0)". And your SM will be up and running in a flash.

I uninstalled the WLP version I had and installed 6.9.19. Same problem

It never ceases to amaze me why users keep on reinstalling when troubleshooting. Wish it were that simple but unfortunately, it's not a solution: I have a problem. Tried to reinstall Wealth-Lab, but it didn't help!
profile picture


P.P.S. Since we've accumulated a lot of solutions over the years, searching the forum (e.g. for "error in xml") has become a power tool. Give it a try and you'll be pleased by its nearly real-time operation. Here's what you might find:

Strategy Monitor error: "There is an error in XML document"
Strategy Monitor: Error in XML document
profile picture


That worked...thanks for the quick response! BTW, to be fair, I wasn't really expecting the re-installation to solve the problem. I just used the opportunity to upgrade to the latest version. Honest!
profile picture


It never ceases to amaze me why users keep on reinstalling when troubleshooting. ... unfortunately, it's not a solution
The installer for most Windows applications sets configurations in the Windows registry, which get outdated or corrupted occasionally. So running many installers resets these registry configurations, which may fix the problem. It's a good approach for most Windows applications--but not WL.

Early on, it was explained to me that the Wealth-Lab installer puts very little in the Windows registry. Rather, it stores configuration details in its own config file. In this case, deleting (or renaming) that config file will restore it to a functional form again without reinstalling. But that's not typical of most Windows applications.

I often wondered why WL does this differently from other Windows applications? Perhaps it lets WL users move their WL application from one "private" computer to another more easily. On enterprise Windows systems, their registry settings are saved on the domain controller, so one's registry settings move with the user from one enterprise login to the next automatically. That part of the Windows Active Directory (AD) design.
profile picture


.NET Framework applications like WL use XML files for configuration. Yes, it lets transfer the configuration more easily.
profile picture


The registry is a bad place to save configuration settings per-user. What a mess that would be for computers with more than one user!
profile picture


The registry is a bad place to save configuration settings per-user. What a mess that would be for computers with more than one user!
There are two independent hives for registry settings. Application settings that apply to all users on a computer should be saved in the HKEY_LOCAL_MACHINE/SOFTWARE hive, and application settings that are different per user should go into the HKEY_USERS hive. Primary copies of all hives are saved on the enterprise domain controller.

Even if several family members share the same computer (or Windows workgroup), if they each have a separate Windows login on that machine, their HKEY_USERS application settings should remain separate for each login. If you buy a new computer, the file transfer wizard will move both the HKEY_LOCAL_MACHINE and HKEY_USERS hives to your new computer. But you have to use the transfer wizard; you can't just copy files.

The problem is some developers place all their application settings in the HKEY_LOCAL_MACHINE hive instead of the HKEY_USERS hive forcing users to share the same settings, which is a mess as you mentioned.

.NET Framework applications like WL use XML files for configuration.
I do like .NET's ability to create an XML file out of any collection object with the XmlSerializer; the serializer flattens the object (given its schema). And it can be done with only a few lines of code!

We probably should move this discussion to a Windows development forum. :-)