From: Gordon on
Hi All,

I've encountered a tough situation. I have a client .exe that serializes an
object to a file using the BinaryFormatter and the AssemblyFormat set to
simple. It is deserialized by a different server process running on a remote
machine. Both exes reference the same assembly that contains the class of the
object that is serialized.

I had no problems running the client from the VS 2005 GUI -- the first few
bytes of the serialized file include a reference to the assembly containing
the serialization routing - [VA Pricing Common, Version=1.0.2867.24173,
Culture=neutral, PublicKeyToken=3f3d1021292548fe]. However, when I run the
client as a stand-alone executable, the first few bytes reference the client
exe -- and the server process has no reference to this assembly --
[VAPricingPDClient, Version=1.0.2867.24173, Culture=neutral,
PublicKeyToken=3f3d1021292548fe...

The attempt to deserialize blows up with the following exception:

System.Runtime.Serialization.SerializationException: Unable to find assembly
'VAPricingPDClient, Version=1.0.2867.24173, Culture=neutral,
PublicKeyToken=3f3d1021292548fe'

....in other words, the server process is looking for the client exe, even
though it's only an instance of a class they both reference that is actually
serialized. There's got to be a way to serialize something in an executable
and pass it to another process without running into this error. Does anyone
know how to do this, and could you please provide some insight? Thanks!

Gordon