Rem0o / FanControl.HWInfo

FanControl plugin to import HWInfo sensors.
MIT License
186 stars 26 forks source link

Error With Plugin and HWinfo Pro 7.0 #2

Closed Dazog closed 3 years ago

Dazog commented 3 years ago

3/20/2021 10:20:31 PM: Unhandled exception in FanControl v1.0.0.0 3/20/2021 10:20:31 PM: System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer`1 comparer) at FanControl.Domain.ComputerAccessLayer.Update() at FanControl.Domain.ApplicationClock.DoActions() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 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)

Dazog commented 3 years ago

Devices appear but list temperature as 0c

Rem0o commented 3 years ago

Can you give me more context? Is it immediately when the program starts? From the exception, it seems like you got a duplicate sensor.

Dazog commented 3 years ago

Happens when program launches.

Checked my sensors, I don't see any duplicated.

Rem0o commented 3 years ago

I meant 2 sensors from HWInfo with the same name.

Rem0o commented 3 years ago

Can you attach a debugger and look for a duplicate in the Load method here https://github.com/Rem0o/FanControl.HWInfo/blob/master/HWInfoPlugin.cs ?

ahodges-git commented 3 years ago

I'm seeing the same issues as Dazog, i get the same/similar error logged continuously on startup and then whilst it's running too.

Also reads the sensors as 0c.

Running FanControl v72 with HWInfo plugin, HWInfo64 v7 with shared memory on.

24/03/2021 3:57:27 PM: Unhandled exception in FanControl v1.0.0.0 24/03/2021 3:57:27 PM: System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer`1 comparer) at FanControl.Domain.ComputerAccessLayer.Update() at FanControl.Domain.ApplicationClock.DoActions() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 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)

Rem0o commented 3 years ago

@ahodges-git again, seems like there is some kind of duplicate sensor ( with the same name ) which conflicts with the internal mechanics which expects unique names.

Rem0o commented 3 years ago

Implemented a more robust ID system https://github.com/Rem0o/FanControl.HWInfo/commit/6755e81297bd5f5202568d3faf73ee97b07d499e