charliefoxtwo/Virpil-Communicator

Exception thrown when more than one device with the same PID is connected

Opened this issue · 0 comments

From discord:

info: ViLA.Program[0]
      Loaded plugin SimConnectSubscriberPlugin
info: ViLA.Program[0]
      Loaded plugin SamplePlugin
Unhandled exception. System.ArgumentException: An item with the same key has already been added. Key: 601
   at System.Collections.Generic.Dictionary2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable1 source, Func2 keySelector, IEqualityComparer1 comparer)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable1 source, Func2 keySelector)
   at Virpil.Communicator.VirpilMonitor..ctor(ILoggerFactory loggerFactory, IEnumerable`1 devices)
   at Virpil.Communicator.VirpilMonitor.Initialize(ILoggerFactory loggerFactory)
   at ViLA.Program.Main(String[] args)
   at ViLA.Program.<Main>(String[] args)

This could use an update that supports additional lookups by serial number