[Mono-dev] Problem with BinarySerialization

Robert Jordan robertj at gmx.net
Wed Feb 3 05:23:19 EST 2010


On 03.02.2010 10:49, PFJ wrote:
>
> Hi,
>
>
> Robert Jordan wrote:
>>
>> On 02.02.2010 14:35, PFJ wrote:
>>>> Thus, the only *clean* way to solve this is introducing a shared
>>>> assembly implementing the classes you want to serialize. It's a
>>>> common pattern.
>>>>
>>>
>>> As the serializer is only used once, can the other app just deserialize
>>> and
>>> use it? I've reimplemented the Elements class but now just have a little
>>> problem in accessing it...
>>
>> It doesn't matter how often, in which way or how symmetric
>> the de/serialization is performed. What counts is the type identity.
>>
>
> Hmm, I guess that is why after I've sorted out the code (thanks), added in
> the Elements class and now have it compiled, I'm getting the same error as I
> did originally (SerializationError - can't find 'elements').

Did you create a separate shared assembly or have you just
included the Elements class in both projects? The latter does
not ensure type identity and it's not what you want.

Robert



More information about the Mono-devel-list mailing list