Chocolateygui: Support displaying multiple versions of locally installed packages

Created on 19 Jun 2017  路  10Comments  路  Source: chocolatey/ChocolateyGUI

Seems I had 2 chocolatey packages installed, one was old version 0.9.10.3 which caused the problem and choco uninstall chocolatey --version=0.9.10.3 fixed the issue.

Bug

Most helpful comment

Cool. Will fix that later this evening.

All 10 comments

Likewise; I had chocolatey version 0.10.3 installed alongside 0.10.7. I'm not sure why this happened but since choco kept working it seems like ChocolateyGUI ought to at least ignore duplicate packages, if not warn the user about specific conflicts.

If anyone runs into this issue again, can you post logs with the origin of the crash? Not sure where this is failing. Logs can be found in C:\ProgramData\ChocolateyGUI\Logs.

I dug out this log from %APPDATA%\ChocolateyGUI\Logs\Chocolatey.gui.debug. Hope it helps to narrow things down, I'm not really familiar with debugging C#. I'm not sure whether it's unique to having two versions of chocolatey installed, or two versions of any package.

2017-04-06 19:59:43,726 [1] INFO ChocolateyGui.App [(null)] - Starting...
2017-04-06 19:59:44,306 [1] DEBUG ChocolateyGui.App [(null)] - First Chance Exception
System.IO.FileNotFoundException: Could not load file or assembly 'System.XmlSerializers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
File name: 'System.XmlSerializers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

2017-04-06 19:59:48,260 [1] DEBUG ChocolateyGui.App [(null)] - First Chance Exception
System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
2017-04-06 19:59:48,261 [1] DEBUG ChocolateyGui.App [(null)] - First Chance Exception
System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at ChocolateyGui.Services.CSharpChocolateyPackageService.<GetInstalledPackages>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
2017-04-06 19:59:48,265 [1] FATAL ChocolateyGui.ViewModels.Controls.LocalSourceControlViewModel [(null)] - Packages failed to load
System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at ChocolateyGui.Services.CSharpChocolateyPackageService.<GetInstalledPackages>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ChocolateyGui.ViewModels.Controls.LocalSourceControlViewModel.<LoadPackages>d__41.MoveNext()
2017-04-06 19:59:50,320 [1] DEBUG ChocolateyGui.App [(null)] - First Chance Exception
System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at ChocolateyGui.Services.CSharpChocolateyPackageService.<GetInstalledPackages>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ChocolateyGui.ViewModels.Controls.LocalSourceControlViewModel.<LoadPackages>d__41.MoveNext()
2017-04-06 19:59:50,321 [1] DEBUG ChocolateyGui.App [(null)] - First Chance Exception
System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at ChocolateyGui.Services.CSharpChocolateyPackageService.<GetInstalledPackages>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ChocolateyGui.ViewModels.Controls.LocalSourceControlViewModel.<LoadPackages>d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
2017-04-06 19:59:50,322 [1] FATAL ChocolateyGui.ViewModels.Controls.LocalSourceControlViewModel [(null)] - Local source control view model failed to load.
System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at ChocolateyGui.Services.CSharpChocolateyPackageService.<GetInstalledPackages>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ChocolateyGui.ViewModels.Controls.LocalSourceControlViewModel.<LoadPackages>d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ChocolateyGui.ViewModels.Controls.LocalSourceControlViewModel.<Loaded>d__35.MoveNext()
2017-04-06 19:59:50,323 [1] DEBUG ChocolateyGui.App [(null)] - First Chance Exception
System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at ChocolateyGui.Services.CSharpChocolateyPackageService.<GetInstalledPackages>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ChocolateyGui.ViewModels.Controls.LocalSourceControlViewModel.<LoadPackages>d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ChocolateyGui.ViewModels.Controls.LocalSourceControlViewModel.<Loaded>d__35.MoveNext()
2017-04-06 19:59:50,323 [1] DEBUG ChocolateyGui.App [(null)] - First Chance Exception
System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at ChocolateyGui.Services.CSharpChocolateyPackageService.<GetInstalledPackages>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ChocolateyGui.ViewModels.Controls.LocalSourceControlViewModel.<LoadPackages>d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ChocolateyGui.ViewModels.Controls.LocalSourceControlViewModel.<Loaded>d__35.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
2017-04-06 19:59:50,326 [1] FATAL ChocolateyGui.App [(null)] - Unhandled Exception
System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at ChocolateyGui.Services.CSharpChocolateyPackageService.<GetInstalledPackages>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ChocolateyGui.ViewModels.Controls.LocalSourceControlViewModel.<LoadPackages>d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ChocolateyGui.ViewModels.Controls.LocalSourceControlViewModel.<Loaded>d__35.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at ChocolateyGui.App.Main()

Awesome, that does help! And it'll fail on any doubly installed package. @ferventcoder Is having multiple versions installed something I should support in GUI?

@RichiCoder1 support it, maybe not?

Show it in the local list, yes. Not fail when you have multiple items, definitely yes. There are scenarios where this is the case.

Cool beans. I'll see about rewriting that bit of logic. What should happen when there's two different version irt to updates? With the current logic it'll try and update both if they're not pinned.

@RichiCoder1 if they are SideBySide (Package Information will have AllowMultiple set to true), you update neither of them.

Cool. Will fix that later this evening.

@RichiCoder1 how did you get on with this one?

Looks like this issue is already resolved! At some point during the Chocolatey interface rework, the package caching code got ditched. That being said, we don't respect SxS, so I'm going to fix that.

Was this page helpful?
0 / 5 - 0 ratings