rubberduck-vba / Rubberduck

Every programmer needs a rubberduck. COM add-in for the VBA & VB6 IDE (VBE).
https://rubberduckvba.com
GNU General Public License v3.0
1.91k stars 299 forks source link

Error loading RD: Exception has been thrown by the target of an invocation. #5422

Closed djrivers closed 4 years ago

djrivers commented 4 years ago

Rubberduck version information The info below can be copy-paste-completed from the first lines of Rubberduck's log or the About box:

Rubberduck version Any Version
Operating System: Microsoft Windows NT 10.0.18362.0 x64
Host Product: Microsoft Office x64
Host Version: 16.0.12430.20288
Host Executable: MSACCESS.EXE;

Description After I installed the update pre-version (Rubberduck v2.5.0.5381-pre). I got that error. I was able to use MS Access yesterday. When I'm about to work today and saw that there is a new update, I went ahead and install then I got this error. I tried to go back to the last working version that I was able to use (Rubberduck.Setup.2.5.0.5367-pre), still getting the error. I installed the latest green release (Rubberduck.Setup.2.5.0.5244) still getting the error.

To Reproduce Steps to reproduce the behavior:

  1. Install pre version (Rubberduck v2.5.0.5381-pre)
  2. Launch MS Access.
  3. Open visual basic editor.

Expected behavior Everything will load just fine.

Screenshots RDError

Logfile Rubberduck generates extensive logging in TRACE-Level. If no log was created at %APPDATA%\Rubberduck\Logs, check your settings. Include this log for bug reports about the behavior of Rubberduck.

RubberduckLog.txt

Additional context Add any other context about the problem here.

Vogel612 commented 4 years ago
2020-03-09 15:50:23.3540;FATAL-;Rubberduck._Extension;System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: '.', hexadecimal value 0x00, is an invalid character. Line 9, position 1. (C:\Users\Darren\AppData\Local\Microsoft_Corporation\DefaultDomain_Path_xjc5kco13wcyjoec1mjbd3rf33or2jio\16.0.12527.20242\user.config line 9) ---> System.Xml.XmlException: '.', hexadecimal value 0x00, is an invalid character. Line 9, position 1.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars)
   at System.Xml.XmlTextReaderImpl.ParseText()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at System.Configuration.XmlUtil.StrictReadToNextElement(ExceptionAction action)
   at System.Configuration.BaseConfigurationRecord.ScanSectionsRecursive(XmlUtil xmlUtil, String parentConfigKey, Boolean inLocation, String locationSubPath, OverrideModeSetting overrideMode, Boolean skipInChildApps)
   at System.Configuration.BaseConfigurationRecord.ScanSectionsRecursive(XmlUtil xmlUtil, String parentConfigKey, Boolean inLocation, String locationSubPath, OverrideModeSetting overrideMode, Boolean skipInChildApps)
   at System.Configuration.BaseConfigurationRecord.ScanSections(XmlUtil xmlUtil)
   at System.Configuration.BaseConfigurationRecord.InitConfigFromFile()
   --- End of inner exception stack trace ---
   at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
   at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
   at System.Configuration.ClientConfigurationSystem.OnConfigRemoved(Object sender, InternalConfigEventArgs e)
   --- End of inner exception stack trace ---
   at System.Configuration.ConfigurationManager.PrepareConfigSystem()
   at System.Configuration.ConfigurationManager.RefreshSection(String sectionName)
   at System.Configuration.ClientSettingsStore.ReadSettings(String sectionName, Boolean isUserScoped)
   at System.Configuration.LocalFileSettingsProvider.GetPropertyValues(SettingsContext context, SettingsPropertyCollection properties)
   at System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider)
   at System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName)
   at System.Configuration.SettingsBase.get_Item(String propertyName)
   at System.Configuration.ApplicationSettingsBase.GetPropertyValue(String propertyName)
   at System.Configuration.ApplicationSettingsBase.get_Item(String propertyName)
   at Rubberduck.Properties.Settings.get_GeneralSettings() in C:\projects\rubberduck\Rubberduck.Core\Properties\Settings.Designer.cs:line 299
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
   at Rubberduck.Settings.DefaultSettings`2.<>c__DisplayClass5_0.<.ctor>b__1(PropertyInfo prop) in C:\projects\rubberduck\Rubberduck.SettingsProvider\Facade\DefaultSettings.cs:line 36
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Enumerable.<CastIterator>d__97`1.MoveNext()
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at Rubberduck.SettingsProvider.ConfigurationServiceBase`1.LoadCacheValue() in C:\projects\rubberduck\Rubberduck.SettingsProvider\Facade\ConfigurationServiceBase.cs:line 35
   at Rubberduck._Extension.InitializeAddIn() in C:\projects\rubberduck\Rubberduck.Main\Extension.cs:line 163;System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: '.', hexadecimal value 0x00, is an invalid character. Line 9, position 1. (C:\Users\Darren\AppData\Local\Microsoft_Corporation\DefaultDomain_Path_xjc5kco13wcyjoec1mjbd3rf33or2jio\16.0.12527.20242\user.config line 9) ---> System.Xml.XmlException: '.', hexadecimal value 0x00, is an invalid character. Line 9, position 1.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars)
   at System.Xml.XmlTextReaderImpl.ParseText()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at System.Configuration.XmlUtil.StrictReadToNextElement(ExceptionAction action)
   at System.Configuration.BaseConfigurationRecord.ScanSectionsRecursive(XmlUtil xmlUtil, String parentConfigKey, Boolean inLocation, String locationSubPath, OverrideModeSetting overrideMode, Boolean skipInChildApps)
   at System.Configuration.BaseConfigurationRecord.ScanSectionsRecursive(XmlUtil xmlUtil, String parentConfigKey, Boolean inLocation, String locationSubPath, OverrideModeSetting overrideMode, Boolean skipInChildApps)
   at System.Configuration.BaseConfigurationRecord.ScanSections(XmlUtil xmlUtil)
   at System.Configuration.BaseConfigurationRecord.InitConfigFromFile()
   --- End of inner exception stack trace ---
   at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
   at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
   at System.Configuration.ClientConfigurationSystem.OnConfigRemoved(Object sender, InternalConfigEventArgs e)
   --- End of inner exception stack trace ---
   at System.Configuration.ConfigurationManager.PrepareConfigSystem()
   at System.Configuration.ConfigurationManager.RefreshSection(String sectionName)
   at System.Configuration.ClientSettingsStore.ReadSettings(String sectionName, Boolean isUserScoped)
   at System.Configuration.LocalFileSettingsProvider.GetPropertyValues(SettingsContext context, SettingsPropertyCollection properties)
   at System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider)
   at System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName)
   at System.Configuration.SettingsBase.get_Item(String propertyName)
   at System.Configuration.ApplicationSettingsBase.GetPropertyValue(String propertyName)
   at System.Configuration.ApplicationSettingsBase.get_Item(String propertyName)
   at Rubberduck.Properties.Settings.get_GeneralSettings() in C:\projects\rubberduck\Rubberduck.Core\Properties\Settings.Designer.cs:line 299
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
   at Rubberduck.Settings.DefaultSettings`2.<>c__DisplayClass5_0.<.ctor>b__1(PropertyInfo prop) in C:\projects\rubberduck\Rubberduck.SettingsProvider\Facade\DefaultSettings.cs:line 36
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Enumerable.<CastIterator>d__97`1.MoveNext()
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at Rubberduck.SettingsProvider.ConfigurationServiceBase`1.LoadCacheValue() in C:\projects\rubberduck\Rubberduck.SettingsProvider\Facade\ConfigurationServiceBase.cs:line 35
   at Rubberduck._Extension.InitializeAddIn() in C:\projects\rubberduck\Rubberduck.Main\Extension.cs:line 163

This seems to be deep within the entrails of configuration loading. Could you try reinstalling Rubberduck to see whether that fixes the problem? if not, can you attach your user configuration?

djrivers commented 4 years ago

Hi,

Yes, I already tried to uninstall and reinstall different pre versions and green versions of RD but I am still getting the error. Where can I find the user configuration?

djrivers commented 4 years ago

Found it. Here it is,

rubberduck - Copy.txt

djrivers commented 4 years ago

I got it working now so I'm closing this. Thanks.

bclothier commented 4 years ago

Do you mind sharing what you did to get it working? It may be helpful for others in future.

djrivers commented 4 years ago

Of course. I just followed the path C:\Users\Darren\AppData\Local\Microsoft_Corporation\DefaultDomain_Path_xjc5kco13wcyjoec1mjbd3rf33or2jio\16.0.12527.20242\user.config and found that the user.config is corrupted. There were several other folders there that when I opened contains the same file (user.config) that is readable. I just copied it and replaced the file in that directory. I launched MS Access and RD started loading.