Hi Chris
I have added watches at the copied the value when the app stops (I send the text 'hello'). It is reading the line and things seems ok to me.
bufferLength 7 int bufferMax 1024 int bufferMax - bufferLength 1017 int - buffer {byte[1024]} byte[] [0] 104 byte [1] 101 byte [2] 108 byte [3] 108 byte [4] 111 byte [5] 13 byte [6] 10 byte [7] 0 byte [8] 0 byte [9] 0 byte [10] 0 byte . . [1023] 0 byte
For now I'm surviving by adding a try/catch around the read call:
int bytesReceived = 0; try { bytesReceived = serialPort.Read(buffer, bufferLength, bufferMax - bufferLength); } catch { Debug.Print("SerialPort exception"); }