Home Support Forums

Main Menu

Login

Note: The Issue Tracker currently has a separate login.



Support Forums
Welcome, Guest
Please Login or Register.    Lost Password?
HIDDManager.GetDetails(): cast exeption
(1 viewing) 1 Guest
Go to bottomPost New TopicPost Reply
TOPIC: HIDDManager.GetDetails(): cast exeption
#11
Uwbe25

HIDDManager.GetDetails(): cast exeption 2 Years, 6 Months ago  
When the HIDLib used in C#/Visual Studio 2008 the function HIDManager.GetDetails() fails with the exception

System.InvalidCastException: Unable to cast object of type 'System.Collections.ObjectModel.ReadOnlyCollection`1[BlueNinjaSoftware.HIDLib.HIDDevice]' to type 'System.Collections.Generic.List`1[BlueNinjaSoftware.HIDLib.HIDDevice]'.
at BlueNinjaSoftware.HIDLib.HIDManagement.GetDevices() in C:Blue Ninja SoftwareCodeCommonLibrariesHIDLibsrcHIDManagement.vb:line 31

no matter what the left side of the assignment is (List<HIDDevice> devices, var devices, IList<HIDDevice> )
 
Logged Logged
  Reply Quote
#13
Uwbe25

Re:HIDDManager.GetDetails(): cast exeption 2 Years, 6 Months ago  
sorry, the function in question is HIDManager.GetDevices()....
 
Logged Logged
  Reply Quote
#14
Blue Ninja
Moderator
Posts: 12
graph
User Offline Click here to see the profile of this user
Gender: Male
Re:HIDDManager.GetDetails(): cast exeption 2 Years, 6 Months ago Karma: 0
Thanks for taking the time to report this. The actual enumerable type returned is Collections.ObjectModel.ReadOnlyCollection(Of HIDDevice), but we haven't come across the same casting issue when using a List or IEnumerable type. I will try to duplicate this issue this afternoon and let you know what I come across.
 
Logged Logged
  Reply Quote
Go to topPost New TopicPost Reply