Please see our tutorial on sending custom object type https://networkcomms.net/custom-objects/, if the client and server are both NetworkComms.Net you should not be doing this:
IFormatter formatter = new BinaryFormatter();
MemoryStream stream = new MemoryStream(message);
User t = formatter.Deserialize(stream) as User;
stream.Close();
Marc