A: 

The first thing I'd try changing is here:

            do
            {
                // !!! problematic function call here !!!
                int BytesRead = NPSS.Read(PipeDataBuffer, 0, PipeDataBuffer.Length);
                // !!!
                MessageStream.Write(PipeDataBuffer, 0, BytesRead);
                TotalBytesRead += BytesRead;
            } while (!NPSS.IsMessageComplete);

It doesn't check that BytesRead is +ve; now I would expect MessageStream.Write to explode if it was negative, but... either way; I would definitely check for an unexpected <=0 condition there.

Marc Gravell
Thanks for the suggestion - I added some code to print the value of BytesRead and it was reading the correct number each time, there was no zero or negative byte read. So unfortunately that's not it.
Frank Hamming
A: 

All sorted, please ignore!

(Question has the solution details - TL;DR it wasn't a problem in NamedPipeServerStream.)

Frank Hamming