I'm attempting to move an object graph from a server process to a client. And it works. At least it works when the both the client and server are on my dev virtual machine. It also works when I run the server on my base machine (client on dev vm).
It stops working though, when I run the server on my media centre PC. The exception is:
Binary stream '0' does not contain a valid BinaryHeader. Possible causes are invalid stream or object version change between serialization and deserialization.
All three PC's are x64 Windows 7 machines. I'm using TCPClient and TCPListener along with the BinaryFormatter
class to do the heavy lifting.
The data being transferred is read from a file using a standard FileStream
object.
If at the client end I serialize the buffers to a file, the contents (according to BeyondCompare) do actually seem to differ?!?
All string properties on my objects are Base64 encoded in the setters and decoded in the getters.
I can post code but I'm not sure where the problem area lies? Any ideas?