arkein / Hearthstone-Treasury

Budget management plugin for Hearthstone Deck Tracker
8 stars 3 forks source link

Error loading plugin after latest HS update #2

Open Lachann opened 7 years ago

Lachann commented 7 years ago

Treasury started failing on load or when enabled in HDT options with:

2:12:31 PM|Info|ErrorManager.AddError >> New error: Error loading Plugin "Treasury"
Make sure you are using the latest version of the Plugin and HDT.

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.XmlTextReaderImpl.Read()
   at System.Xml.XmlTextReader.Read()
   at System.Xml.XmlReader.MoveToContent()
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderPluginSettingsViewModel.Read4_PluginSettingsViewModel()
   --- 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 Hearthstone_Deck_Tracker.XmlManager`1.Load(String path)
   at Hearthstone_Treasury.ViewModels.PluginSettingsViewModel.LoadSettings(String filePath)
   at Hearthstone_Treasury.HearthstoneTreasuryPlugin.OnLoad()
   at Hearthstone_Deck_Tracker.Plugins.PluginWrapper.Load()
2:12:31 PM|Error|PluginWrapper.Load >> Treasury:
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.XmlTextReaderImpl.Read()
   at System.Xml.XmlTextReader.Read()
   at System.Xml.XmlReader.MoveToContent()
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderPluginSettingsViewModel.Read4_PluginSettingsViewModel()
   --- 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 Hearthstone_Deck_Tracker.XmlManager`1.Load(String path)
   at Hearthstone_Treasury.ViewModels.PluginSettingsViewModel.LoadSettings(String filePath)
   at Hearthstone_Treasury.HearthstoneTreasuryPlugin.OnLoad()
   at Hearthstone_Deck_Tracker.Plugins.PluginWrapper.Load()

Started happening today, after updating Hearthstone and HDT to version 1.3.2. Using the latest Treasury plugin v.0.4.1.

arkein commented 7 years ago

Thanks for letting me know, will check soon.

arkein commented 7 years ago

TL;DR Fresh install on HDT 1.3.5 runs nicely. Backup data, reinstall the plugin.

I've fresh installed Treasury with latest HDT 1.3.5 - no troubles so far. There've been a number of changes in the plugin system recently, it could be that your local Treasury data was moved/corrupted, e.g. during the HDT version upgrade.

  1. Backup the plugin data. There are two files in c:\Users\User\AppData\Roaming\HearthstoneDeckTracker\Treasury\ transactions.xml - that's history of your transactions. treasury.config.xml - that's just some plugin window settings: initial balance, locale.

  2. Close HDT. Either remove completely or just archive and put aside Treasury folder(s) from c:\Users\User\AppData\Roaming\HearthstoneDeckTracker\ and c:\Users\User\AppData\Roaming\HearthstoneDeckTracker\Plugins\Treasury

  3. Open HDT, plugins pane. Drag n drop latest Treasury.zip file there - it will be installed automatically. Enable plugin, open it, enter some transactions, close plugin. Close HDT.

  4. Find transactions.xml and treasury.config.xml in c:\Users\User\AppData\Roaming\HearthstoneDeckTracker. Overwrite with your backup version.

Start HDT, plugin should be showing the full history.