I don’t really understand what the problem is you are experiencing but I could tell you how I serialize into a binary stream I stream can be send or saved to file. Serializing to XML goes the same way. Note both serializer and deserializer and the object definition of the object to serialize should be the same at the sending and receiving end. To ensure this I simply put the classes in a dll which both sides use. With dotnet 1.x the formatter will give an exception when a version difference is detected. In dotnet 2.0 the formatter will serialize everything it recognizes even if there are version differences. The class to serialize should be declared with [Serializable] /// /// Serialize object to byte array, object must be Serializable /// /// object to serialize /// array public byte[] Serialize(T someobject) { byte[] objectstream=null; BinaryFormatter f = new BinaryFormatter(); MemoryStream stream = new MemoryStream(); f.Serialize(stream, someobject); stream.SetLength( stream.Position); objectstream = stream.GetBuffer(); return objectstream; } public void Deserialize(byte[] stream, out T someobject) { BinaryFormatter f = new BinaryFormatter(); MemoryStream serstream = new MemoryStream(stream); someobject = (T)f.Deserialize(serstream); } Class def of class to serialize: [Serializable] public class SetConfigMessage { public string Name = ""; public string Value = ""; /// /// Config message /// /// /// public SetConfigMessage() { } public SetConfigMessage(string name, string value) { this.Name = name; this.Value = value; } } madv113