LGSTrayBattery icon indicating copy to clipboard operation
LGSTrayBattery copied to clipboard

Cannot start second instance

Open Zenrage opened this issue 4 years ago • 2 comments

Cannot start second instance of this application as I have multiple Logitech devices.

The exception is thrown when application tries to see what last device was used/found on startup. Create a new list when enumerating maybe (I tested this and got it to work on an older clone.

Zenrage avatar Apr 04 '22 05:04 Zenrage

image

Zenrage avatar Apr 04 '22 05:04 Zenrage

System.InvalidOperationException: Collection was modified; enumeration operation may not execute. at System.Collections.Generic.List1.Enumerator.MoveNextRare() at System.Collections.Generic.List1.Enumerator.MoveNext() at System.Linq.Enumerable.SelectManySingleSelectorIterator2.MoveNext() at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable1 source, Func2 predicate, Boolean& found) at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source, Func2 predicate) at LGSTrayGUI.MainWindowViewModel.UpdateSelectedDeviceOnLaunch(Object sender, PropertyChangedEventArgs e) at LGSTrayGUI.MainWindowViewModel.<>c__DisplayClass26_01.<RegisterDeviceManager>b__0(Object o, NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ObservableCollection1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ObservableCollection1.InsertItem(Int32 index, T item) at System.Collections.ObjectModel.Collection1.Add(T item) at LGSTrayHID.HIDDeviceManager._deviceListener_DeviceInitialized(Object sender, DeviceEventArgs e) at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_1(Object state) at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi) at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext executionContext, Action1 callback, TState& state) at System.Threading.QueueUserWorkItemCallback.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Zenrage avatar Apr 04 '22 05:04 Zenrage