fernandreu / office-ribbonx-editor

An overhauled fork of the original Custom UI Editor for Microsoft Office, built with WPF
MIT License
516 stars 100 forks source link

DependencyResolutionException: An exception was thrown while activating OfficeRibbonXEditor.ViewModels.Windows.MainWindowViewModel. #160

Open BerendStorm opened 3 years ago

BerendStorm commented 3 years ago

Describe the bug

Autofac.Core.DependencyResolutionException: An exception was thrown while activating OfficeRibbonXEditor.ViewModels.Windows.MainWindowViewModel. ---> Autofac.Core.DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(OfficeRibbonXEditor.Interfaces.IMessageBoxService, OfficeRibbonXEditor.Interfaces.IFileDialogService, OfficeRibbonXEditor.Interfaces.IVersionChecker, OfficeRibbonXEditor.Interfaces.IDialogProvider, OfficeRibbonXEditor.Interfaces.IUrlHelper)' on type 'MainWindowViewModel'. ---> System.Configuration.ConfigurationErrorsException: Kan het configuratiesysteem niet initialiseren ---> System.Configuration.ConfigurationErrorsException: Niet-herkende configuratiesectie userSettings (C:\Users\bstor\AppData\Local\Fernando_Andreu\OfficeRibbonXEditor.exe_Url_ms1ab4w4nmqtiaapfpju3g3yc2fmcqx5\1.7.1.886\user.config line 3)
   bij System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
   bij System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
   bij System.Configuration.ClientConfigurationSystem.OnConfigRemoved(Object sender, InternalConfigEventArgs e)
   --- Einde van intern uitzonderingsstackpad ---
   bij System.Configuration.ConfigurationManager.PrepareConfigSystem()
   bij System.Configuration.ConfigurationManager.get_AppSettings()
   bij System.Windows.FrameworkCompatibilityPreferences..cctor()
   --- Einde van intern uitzonderingsstackpad ---
   bij Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
   bij Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
   bij Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget)
   --- Einde van intern uitzonderingsstackpad ---
   bij Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget)
   bij Autofac.Core.Resolving.InstanceLookup.Execute()
   bij Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
   bij Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters)
   bij Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance)
   bij Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
   bij Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context, IEnumerable`1 parameters)
   bij OfficeRibbonXEditor.App.LaunchMainWindow()
   bij System.Windows.Application.<.ctor>b__1_0(Object unused)
   bij System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   bij System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

To Reproduce Please describe the steps that lead to the unhandled exception here, including example files if relevant.

Screenshots If applicable, add screenshots to help explain how the unhandled exception occurred.

Additional context

fernandreu commented 3 years ago

Hi BerendStorm,

Did this error occur when doing something in particular, e.g. after an upgrade from a previous version?

Also, if it exists, could you pass me the following file or paste its contents here? C:\Users\bstor\AppData\Local\Fernando_Andreu\OfficeRibbonXEditor.exe_Url_ms1ab4w4nmqtiaapfpju3g3yc2fmcqx5\1.7.1.886\user.config

It should not have any confidential information in theory, but rather things like the position of the window the last time you opened the tool, the editor color scheme, etc.

If the problem still persists, one workaround would be to delete all folders in C:\Users\bstor\AppData\Local\Fernando_Andreu (you will lose any settings you might have applied).

BerendStorm commented 3 years ago

Hi Fernando,

As far as I remember it occurred after an update and it occurs at every startup of the app. Strangely enough I can still use after closing the error screen.

I attached the user config file as requested. As far as I can see it only contains the interface settings. Mainly the colors.

As a developer I’m interested to see what might be the cause. BTW I also have the latest version of MS Visual Studio (VB) installed. Perhaps there is a conflicting situation between the DLL’s.

Kind regards,

Berend Storm

fernandreu commented 3 years ago

It seems GitHub blocks attachments when you send them via email reply. Could you pass it via the website instead? Although, from what you say, it doesn't look that different from what I would have expected. I might just corrupt one of these files myself and see how the tool behaves and what I would need to fix.

It's definitely something I have not seen before. It seems it is not uncommon, but the solutions in there are for the developers, not for the end users. The tool attempts to upgrade those settings files from previous versions, so I wonder if that's contributing to the issue too.

In any case, if it lets you continue using the tool after the exception dialog, feel free to do so. The worst thing that could happen in theory is that your settings from previous sessions might not be persisted.

BerendStorm commented 3 years ago

Hi Fernando, It's no problem tot continue working with the app. I primarily wanted to report the problem. BTW. I like the tabbed interface with multiple open files 👍 I wonder if you find the cause of the error and wait for the next update. Regards, Berend

Berend Storm, Sjabloonspecialist


From: Fernando Andreu @.> Sent: Friday, May 21, 2021 10:20:15 PM To: fernandreu/office-ribbonx-editor @.> Cc: Berend Storm @.>; Author @.> Subject: Re: [fernandreu/office-ribbonx-editor] DependencyResolutionException: An exception was thrown while activating OfficeRibbonXEditor.ViewModels.Windows.MainWindowViewModel. (#160)

It seems GitHub blocks attachments when you send them via email reply. Could you pass it via the website instead? Although, from what you say, it doesn't look that different from what I would have expected. I might just corrupt one of these files myself and see how the tool behaves and what I would need to fix.

It's definitely something I have not seen before. It seems it is not uncommonhttps://stackoverflow.com/questions/13298884/c-sharp-errorunrecognized-configuration-section-usersettings-stop-program-rea, but the solutions in there are for the developers, not for the end users. The tool attempts to upgrade those settings files from previous versions, so I wonder if that's contributing to the issue too.

In any case, if it lets you continue using the tool after the exception dialog, feel free to do so. The worst thing that could happen in theory is that your settings from previous sessions might not be persisted.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/fernandreu/office-ribbonx-editor/issues/160#issuecomment-846231056, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AUB4NE5GW7VV37IACEIYM3TTO2577ANCNFSM444RDTJQ.

[ { @.": "http://schema.org", @.": "EmailMessage", "potentialAction": { @.": "ViewAction", "target": "https://github.com/fernandreu/office-ribbonx-editor/issues/160#issuecomment-846231056", "url": "https://github.com/fernandreu/office-ribbonx-editor/issues/160#issuecomment-846231056", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { @.": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

fernandreu commented 3 years ago

I can't quite determine the root cause of the error, as it looks like your settings file has the correct section but for some reason the tool does not recognise it. I wonder if language has anything to do with it, although I would expect the section names to be in English in all cases. Version 1.8 has localisation support which might inadvertently fix this too somehow by forcing your UI language to English (given that there is no Dutch translation).

So, instead, let's try to fail safe if that occurs. In the following build, if the tool has a problem reading the settings, it should hopefully delete the file and restart automatically so you may not even notice: https://dev.azure.com/fernandreu-public/OfficeRibbonXEditor/_build/results?buildId=1031&view=artifacts&pathAsName=false&type=publishedArtifacts

I've tested this by adding wrong characters, changing the section names, etc. of my settings file but, as I said, I could not find the root cause of your error, so perhaps it won't work for you.

If you try that build and the problem still occurs just let me know and I will keep investigating.

BerendStorm commented 2 years ago

Hi Fernando,

You suggested that I should download a new release. I checked the site but I can't find a release after 1.9.0.1056 (my current version) which seems to be the latest published one. Can you send me a link to the latest installer?

My current version info:

Version: 1.9.0.1056 Runtime: .NET 6.0.0-rtm.21522.10 Operating System: Microsoft Windows 10.0.19044

fernandreu commented 2 years ago

Hi, 1.9.0 is the latest yeah. There have been some changes in the development builds since then, but they are unrelated to this, so there is no need to try them.

So, just to confirm: do you experience this issue with the latest version 1.9.0 too?

The reason I want to confirm this is because both the new issues mention version 1.7.1.886 instead. #177 just mentions it in the path to the settings file, so perhaps it can occur in version 1.9.0 when migrating the settings to the new version. But #199 mentions it as part of the automated bug report.

BerendStorm commented 2 years ago

I'll test it tomorrow. It's 9.50pm now.

Outlook voor Androidhttps://aka.ms/AAb9ysg downloaden


From: Fernando Andreu @.> Sent: Monday, December 6, 2021 9:15:05 PM To: fernandreu/office-ribbonx-editor @.> Cc: Berend Storm @.>; Author @.> Subject: Re: [fernandreu/office-ribbonx-editor] DependencyResolutionException: An exception was thrown while activating OfficeRibbonXEditor.ViewModels.Windows.MainWindowViewModel. (#160)

Hi, 1.9.0 is the latest yeah. There have been some changes in the development builds since then, but they are unrelated to this, so there is no need to try them.

So, just to confirm: do you experience this issue with the latest version 1.9.0 too?

The reason I want to confirm this is because both the new issues mention version 1.7.1.886 instead. #177https://github.com/fernandreu/office-ribbonx-editor/issues/177 just mentions it in the path to the settings file, so perhaps it can occur in version 1.9.0 when migrating the settings to the new version. But #199https://github.com/fernandreu/office-ribbonx-editor/issues/199 mentions it as part of the automated bug report.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/fernandreu/office-ribbonx-editor/issues/160#issuecomment-987159348, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AUB4NE5YONVFAOMGRNKJLOTUPUKUTANCNFSM444RDTJQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

[ { @.": "http://schema.org", @.": "EmailMessage", "potentialAction": { @.": "ViewAction", "target": "https://github.com/fernandreu/office-ribbonx-editor/issues/160#issuecomment-987159348", "url": "https://github.com/fernandreu/office-ribbonx-editor/issues/160#issuecomment-987159348", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { @.": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

BerendStorm commented 2 years ago

Hi Fernado,

Being a developer myself I couldn't resist doing some research based upon the error report (containing a reference to 1.7.1.886) and your remarks. What I found is that there were 2 subdirectories in the program directory (C:\Users\?????\AppData\Local\Fernando_Andreu). @.*** One from September 8, 2020 and one from November 22, 2021.

After invalidating the oldest subdirectory name by adding an underscore (see screenshot) and using the quickmenu @.*** again, it generates a new directory with today's date (December 7, 2021) and opens the Ribbon Editor as expected.

What I suspect is that the 2020 directory is a remainder from an earlier installation (V 1.7) and is the first one referenced by the Quickmenu. Problem solved at my end 8>))

I hope that this additional information helps you in improving the app even more. Perhaps you could add some code to check for the version, or error trapping that automatically deletes files/subdirs in this directory one-by-one until it works. Or finally generate new ones if none of them work.

BTW: I really love the multi-tab interface which makes it a lot easier to copy items between files.

Kind regards,

Berend Storm

@.**@.

Telefoon:(050) 309 3568 LinkedIn: Berend Storm WEB: www.sjabloonspecialist.nlhttp://www.sjabloonspecialist.nl/ Twitter: @SJABLOONSPECIAL Facebook: SJABLOONSPECIALIST YouTube: SJABLOONSPECIALIST

TeamViewer hulp op afstand

https://get.teamviewer.com/sjabloonspecialist

Dit e-mailbericht is uitsluitend bedoeld voor de geadresseerde(n). Wilt u direct contact met ons opnemen als deze e-mail bij vergissing bij u terecht is gekomen? Wij verzoeken u in dat geval de e-mail te vernietigen, de inhoud ervan niet te gebruiken en niet onder derden te verspreiden, omdat het bericht vertrouwelijke informatie kan bevatten.

Van: Fernando Andreu @.> Verzonden: maandag 6 december 2021 21:15 Aan: fernandreu/office-ribbonx-editor @.> CC: Berend Storm @.>; Author @.> Onderwerp: Re: [fernandreu/office-ribbonx-editor] DependencyResolutionException: An exception was thrown while activating OfficeRibbonXEditor.ViewModels.Windows.MainWindowViewModel. (#160)

Hi, 1.9.0 is the latest yeah. There have been some changes in the development builds since then, but they are unrelated to this, so there is no need to try them.

So, just to confirm: do you experience this issue with the latest version 1.9.0 too?

The reason I want to confirm this is because both the new issues mention version 1.7.1.886 instead. #177https://github.com/fernandreu/office-ribbonx-editor/issues/177 just mentions it in the path to the settings file, so perhaps it can occur in version 1.9.0 when migrating the settings to the new version. But #199https://github.com/fernandreu/office-ribbonx-editor/issues/199 mentions it as part of the automated bug report.

- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/fernandreu/office-ribbonx-editor/issues/160#issuecomment-987159348, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AUB4NE5YONVFAOMGRNKJLOTUPUKUTANCNFSM444RDTJQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. [ { @.": "http://schema.org", @.": "EmailMessage", "potentialAction": { @.": "ViewAction", "target": "https://github.com/fernandreu/office-ribbonx-editor/issues/160#issuecomment-987159348", "url": "https://github.com/fernandreu/office-ribbonx-editor/issues/160#issuecomment-987159348", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { @.": "Organization", "name": "GitHub", "url": "https://github.com" } } ]