2

I'd made a simple program one or two years ago in windows 8 or windows 8.1 that provides serial port connection between Arduino Uno and my C# Form Application. Firstly I check all open com ports in pc and get these ports for connection choice. To do that working code is like given below for those days;

private void portCheck_Click(object sender, EventArgs e)
        {
            foreach (string item in System.IO.Ports.SerialPort.GetPortNames())
            {
                //store the each retrieved available port names into the Listbox...    
                if (!portBox.Items.Contains(item))
                { portBox.Items.Add(item); }
            }
        }

I'm not opened this program for a long while and now I format my computer and make a clean install with windows 10 Education. And when I run this project I realize the program does not found any open com port. It does not enter the foreach loop, simply System.IO.Ports.SerialPort.GetPortNames() doesn't return any port name. I made some research and read about an issue like this situation in windows 10. And peoples gives completely different solutions about serial connections. I don't want to rewrite whole project. So is there anyone know anything about this problem? Is there any simple solution for that?

Ardahan Kisbet
  • 641
  • 1
  • 13
  • 33

3 Answers3

0

Are you certain that the serial port itself is working correctly after the upgrade to Windows 10?

  • Does it appear in Device Manager?
  • Does it appear in the registry under HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM (which is where SerialPort.GetPortNames() gets its information)?

Anecdotally, I maintain software that uses SerialPort.GetPortNames() to enumerate serial ports and it works fine on Windows 10.

Matthew Xavier
  • 2,108
  • 1
  • 13
  • 18
0

This is an old thread but since it wasn't solved and since I just experienced this same issue on a new Win10 laptop, I thought I'd share my solution. I finally figured out that I had to download the VCP driver from Silicon Labs, and after I ran the x64 installer everything worked. I don't think I had to do this on my Win7 laptop so this is an inconvenience of Win10.

jpc2112
  • 23
  • 1
  • 5
0

Мy problem (Win10) is that when removing the device from the USB, the corresponding port does not disappear from the list (SerialPort.GetPortNames(), C#) And it's stay even in the registers. I see:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM]
"\\Device\\USBSER000"="COM11"
"\\Device\\USBSER002"="COM53"
"\\Device\\VCP0"="COM4"
"\\Device\\USBSER001"="COM11"

I understand when the problem occurs, but I do not understand how to bypass it: when I occupy the port and turn off the device from USB, the port name remains in the registers and in the list that Windows returns. enter image description here

NikB
  • 101
  • 3
  • 4