Open Zenrage opened 2 years ago
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.List1.Enumerator.MoveNextRare() at System.Collections.Generic.List
1.Enumerator.MoveNext()
at System.Linq.Enumerable.SelectManySingleSelectorIterator2.MoveNext() at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable
1 source, Func2 predicate, Boolean& found) at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable
1 source, Func2 predicate) at LGSTrayGUI.MainWindowViewModel.UpdateSelectedDeviceOnLaunch(Object sender, PropertyChangedEventArgs e) at LGSTrayGUI.MainWindowViewModel.<>c__DisplayClass26_0
1.1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ObservableCollection
1.InsertItem(Int32 index, T item)
at System.Collections.ObjectModel.Collection`1.Add(T item)
at LGSTrayHID.HIDDeviceManager._deviceListener_DeviceInitialized(Object sender, DeviceEventArgs e)
at System.Threading.Tasks.Task.<>c.
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.