question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GetConnectedDeviceDefinitionsAsync never finishes

See original GitHub issue

Take 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:16 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
frajasalocommented, Apr 8, 2019

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!

1reaction
frajasalocommented, Mar 28, 2019

Sorry have been busy today. I’ll try providing the screenshots tomorrow or on weekend.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found