Skip to content

VB 2019 SerialPortNames duplicate port names #73576

@vsfeedback

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


[severity:It bothers me. A fix would be nice]
Microsoft Visual Studio Community 2019
Version 16.11.2
.NET version 4.8.04084
Visual Basic

Code snippet:

cboCOMPort.Items.Clear()
For Each COMString As String In My.Computer.Ports.SerialPortNames

cboCOMPort.Items.Add(COMString)

Next

ISSUE #1

SerialPort1.PortNames shows incorrect number of ports

Example:

Run VB app, shows COM3, COM4 and COM5

Disconnect COM4, still shows COM3, COM4 and COM5

ISSUE #2

SerialPort1.PortNames shows duplicate port names

Example:

Run VB app, shows COM3, COM4 and COM5

Disconnect COM4 , still shows COM3, COM4 and COM5
Add COM4 , now shows COM3, COM4, COM4 and COM5

When I compile for NET 3.5, I don't have these issues.

Please review and advise.

Thanks

Ken


Original Comments

Feedback Bot on 10/4/2021, 06:01 PM:

(private comment, text removed)

Feedback Bot on 12/1/2021, 08:20 AM:

(private comment, text removed)


Original Solutions

(no solutions)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions