GetConnectedDeviceDefinitionsAsync never finishes
See original GitHub issueTake this basic example:
using Device.Net;
using Hid.Net.Windows;
using System;
namespace ConsoleApp
{
class Program
{
static void Main(string[] args)
{
Test.Find();
Console.ReadLine();
}
}
class Test
{
public static async void Find()
{
WindowsHidDeviceFactory.Register();
var devices = await DeviceManager.Current.GetConnectedDeviceDefinitionsAsync(new FilterDeviceDefinition { VendorId = 0x04D9, ProductId = 0x0130 });
Console.WriteLine("this is never printed to console");
foreach (var device in devices)
{
Console.WriteLine(device.DeviceId);
}
}
}
}
The application hangs before Console.WriteLine("this is never printed to console"); is reached.
Windows 10 x64 with netcore 2.2
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:16 (12 by maintainers)
Top Results From Across the Web
Can't get Device.Net Samples working in Visual Studio. ...
I tried a few things before but never got it to work. I have almost no experience with Visual Studio, .NET or C#....
Read more >ConnectAsync() never finishes in C# Visual Studio
The problem is that sometimes the call to StreamSockets. ConnectAsync() just never finishes or uses an extraordinarily long time to fail with ...
Read more >C# (CSharp) DeviceManager, Navi Examples
GetConnectedDeviceDefinitionsAsync (); // The device manager returns an entry for each endpoints // as a result duplicates are removed by checking against ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Helllo,
and sorry for being late with my answer.
Its strange but now it seems to work as expected. Maybe I had to restart Visual Studio or the whole system after installing the NuGet package !?
Updated to version 2.7.0 and it’s working also.
Thanks!
Sorry have been busy today. I’ll try providing the screenshots tomorrow or on weekend.