chocolatey / ChocolateyGUI

A delicious GUI for Chocolatey
https://docs.chocolatey.org/en-us/chocolatey-gui/
Apache License 2.0
1.61k stars 248 forks source link

Failed to start application. #1036

Open ObnubiladO opened 6 months ago

ObnubiladO commented 6 months ago

Checklist

What You Are Seeing?

https://i.imgur.com/4KcwHAG.png

What is Expected?

Application launch.

How Did You Get This To Happen?

Not sure what happened. It was working fine in W10 and now in W11 it isn't working anymore.

System Details

Installed Packages

No, thanks.

Output Log

2024-01-04 21:15:35.873 +01:00 [Fatal] Failed to start application.
Autofac.Core.DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = ShellView[] (DelegateActivator), Services = [System.Collections.Generic.IEnumerable`1[[ChocolateyGui.Common.Windows.Views.ShellView, ChocolateyGui.Common.Windows, Version=2.1.0.0, Culture=neutral, PublicKeyToken=]]], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = ExternallyOwned ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = ShellView (ReflectionActivator), Services = [ChocolateyGui.Common.Windows.Views.ShellView], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = ChocolateyConfigurationProvider (ReflectionActivator), Services = [ChocolateyGui.Common.Providers.IChocolateyConfigurationProvider], Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An exception was thrown while invoking the constructor 'Void .ctor(chocolatey.infrastructure.filesystem.IFileSystem)' on type 'ChocolateyConfigurationProvider'. ---> Sequence contains more than one matching element (See inner exception for details.) (See inner exception for details.) (See inner exception for details.) (See inner exception for details.) ---> Autofac.Core.DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = ShellView (ReflectionActivator), Services = [ChocolateyGui.Common.Windows.Views.ShellView], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = ChocolateyConfigurationProvider (ReflectionActivator), Services = [ChocolateyGui.Common.Providers.IChocolateyConfigurationProvider], Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An exception was thrown while invoking the constructor 'Void .ctor(chocolatey.infrastructure.filesystem.IFileSystem)' on type 'ChocolateyConfigurationProvider'. ---> Sequence contains more than one matching element (See inner exception for details.) (See inner exception for details.) (See inner exception for details.) ---> Autofac.Core.DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = ChocolateyConfigurationProvider (ReflectionActivator), Services = [ChocolateyGui.Common.Providers.IChocolateyConfigurationProvider], Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An exception was thrown while invoking the constructor 'Void .ctor(chocolatey.infrastructure.filesystem.IFileSystem)' on type 'ChocolateyConfigurationProvider'. ---> Sequence contains more than one matching element (See inner exception for details.) (See inner exception for details.) ---> Autofac.Core.DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(chocolatey.infrastructure.filesystem.IFileSystem)' on type 'ChocolateyConfigurationProvider'. ---> Sequence contains more than one matching element (See inner exception for details.) ---> System.InvalidOperationException: Sequence contains more than one matching element
   at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at ChocolateyGui.Common.Providers.ChocolateyConfigurationProvider.GetChocolateyInstallLocation() in C:\buildAgent\work\774e9aed9020e028\Source\ChocolateyGui.Common\Providers\ChocolateyConfigurationProvider.cs:line 41
   at lambda_method(Closure , Object[] )
   at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
   --- End of inner exception stack trace ---
   at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
   at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
   --- End of inner exception stack trace ---
   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
   at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator)
   at Autofac.Core.Resolving.InstanceLookup.Execute()
   at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
   at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
   --- End of inner exception stack trace ---
   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
   at Autofac.Core.Resolving.InstanceLookup.Execute()
   at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Autofac.Features.Collections.CollectionRegistrationSource.<>c__DisplayClass0_0.<RegistrationsFor>b__0(IComponentContext c, IEnumerable`1 p)
   at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
   --- End of inner exception stack trace ---
   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
   at Autofac.Core.Resolving.InstanceLookup.Execute()
   at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance)
   at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
   at ChocolateyGui.Common.Windows.Bootstrapper.GetAllInstances(Type service) in C:\buildAgent\work\774e9aed9020e028\Source\ChocolateyGui.Common.Windows\Bootstrapper.cs:line 179
   at Caliburn.Micro.ViewLocator.<>c.<.cctor>b__10_0(Type viewType)
   at Caliburn.Micro.ViewLocator.<>c.<.cctor>b__10_8(Object model, DependencyObject displayLocation, Object context)
   at Caliburn.Micro.WindowManager.CreateWindow(Object rootModel, Boolean isDialog, Object context, IDictionary`2 settings)
   at Caliburn.Micro.WindowManager.ShowWindow(Object rootModel, Object context, IDictionary`2 settings)
   at ChocolateyGui.Common.Windows.Bootstrapper.<OnStartup>d__43.MoveNext() in C:\buildAgent\work\774e9aed9020e028\Source\ChocolateyGui.Common.Windows\Bootstrapper.cs:line 138

Additional Context

I tried reinstalling chocolateygui, but it didn't work.

pauby commented 2 months ago

@ObnubiladO it has been some time since this issue was raised. I am unable to replicate the issue on the same version of Chocolatey GUI.

Is this still an issue?

mchin-rch commented 2 weeks ago

ChocolateyGUI has been working fine up until today. I received the same error as ObnubiladO. Oddly enough, I have ChocolateyGUI installed on another identical Windows Server where it works fine.

ObnubiladO commented 2 weeks ago

I reinstalled ChocolateyGUI just now and it actually works for me now. Same PC, same OS, so I don't know what fixed it.

I'm guessing it had something to do with a Windows update or some Windows process.

pauby commented 2 weeks ago

@mchin-rch Given what was said above by @ObnubiladO, this may well be a Windows Update causing it.