title: Available Serial ports are not shown in Visual studio
body: <p>I am recently working on a project for Serial port communication, I want to show the available serial ports in a comboBox, But while running it is not showing the available list of com ports.</p>
  
  <p>My code:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  using System.IO.Ports;
  
  namespace Serial_application
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
             InitializeComponent();
             getPortsNames();
          }
          void getPortsNames()
          {
            string[] ports = SerialPort.GetPortNames();
            comboBox1.Items.AddRange(ports);
          }
       }
   }
  </code></pre>