0

I have a device connected to a USB serial port which can be seen in device manager but not in registry.

When I use SerialPort.GetPortNames() (I am expecting to return all the connected serial ports), it is not returning all the ports from the connected device.

But after re-enabling the port I can see my desired device working and it is gone after restarting the machine.

Updating the drivers didn't help.

andrewJames
  • 19,570
  • 8
  • 19
  • 51
pratap
  • 15
  • 2

1 Answers1

0

You could use the WMI Code Creator from Microsoft to build a query for Win32_SerialPort-Devices or maybe Win32_PnPEntity.

I also got problems with the SerialPort.GetPortNames() in the past, but the Win32-classes worked just fine evertime so far.

Schmittmuthelm
  • 162
  • 2
  • 9