Communicating w Xbee via Windows USB and C Sharp

I am porting an old C#, dotnet4 program that manages communication (between a gateway xbee (attached to workstation) and an xbee attached to an independent sensor) to C#10/dotnet6.

Early in the program, an xbee Reset is sent out to the gateway xbee. This now fails in the new C#10/dotnet6 environment. The failure is that I no longer get a response back from the gateway xbee.

OS: Windows 11 x64
Framework: C# 10, dotnet 6 with NuGet System.IO.Ports --version 7.0.0
Hardware: xbee3 on a sparkfun plugged into USB port COM3

XCTU communicates perfectly with the xbee3 on the sparkfun: (COM3, baud 230400, 8-N-1)

The simplified example below of sending a reset to the gateway xbee worked in the old environment. After much googling for examples and answers, I haven’t found anything except to use the NuGet package, which I am using. Is there more?

I’m seeing more info about Python than C#. Is serial port comm to xbee using C# no longer a thing?

Thanks for any suggestions.

------Simplified Test Code-----
using System.IO.Ports;

System.IO.Ports.SerialPort serialPort = new()
{
PortName = “COM3”,
BaudRate = 230400,
Parity = Parity.None,
DataBits = 8,
StopBits = StopBits.One,
ReadTimeout = 1000
};

serialPort.Open();

byte msg = {0x7E, 0x00, 0x04, 0X08, 0x01, 0x46, 0x56, 0xFF - 0xA1};

Console.WriteLine(“Writing msg: {0:X} {1:X} {2:X} {3:X} {4:X} {5:X} {6:X} {7:X} length: {8}”,
msg[0], msg[1], msg[2], msg[3],
msg[4], msg[5], msg[6], msg[7], msg.Length);

serialPort.DiscardOutBuffer();
serialPort.Write(msg, 0, msg.Length);

try
{
byte byte_read = (byte)serialPort.ReadByte();
Console.WriteLine(“Byte read: {0}”, byte_read);
}
catch (TimeoutException)
{
Console.WriteLine(“serialPort.ReadByte() timeout”);
}

serialPort.Close();

Results:
PS C:\Users\GroundWork\Documents\dev\xbee> dotnet run
Writing msg: 7E 0 4 8 1 46 56 5E length: 8
serialPort.ReadByte() timeout

Simplified Project File:


Exe
net6.0
enable
enable