Think the exception some people are hitting (including me) is a null exception. Replacing “ToString()” with “as string;” should fix this startup issue for some. Have not looked much farther beyond this yet. See last line below. Not sure where to post this.
void timer_Tick(object sender, EventArgs e)
{
string[] ports = SerialPort.GetPortNames();
string[] listPorts = new string[cboxComPorts.Items.Count];
for (int i = 0; i < cboxComPorts.Items.Count; i++)
{
listPorts[i] = cboxComPorts.Items[i].ToString();
}
if (ports != listPorts)
{
cboxComPorts.Items.Clear();
cboxComPorts.Items.AddRange(ports);
string lastPort = Application.UserAppDataRegistry.GetValue("LastPort", null) as string; //.ToString();