[Mono-list] BinaryFormatter, Deserialize(), casting throws exception.
Robert Jordan
robertj at gmx.net
Tue Aug 29 05:05:40 EDT 2006
Wiktor Grębla wrote:
> Robert Jordan napisał(a):
>
>> Because the deserialized data is not of type "Mydata".
>> What's the output of
>>
>> Console.WriteLine (bf.Deserialize(fs).GetType ().FullName)
>>
>
> Mydata (unfortunately).
It could be another version of Mydata.
Try
Console.WriteLine (bf.Deserialize(fs).GetType ().Assembly.FullName)
and
Console.WriteLine (typeof (Mydata).Assembly.FullName)
BTW, try to get a *full* stack trace using
try {
your code
} catch (Exception ex) {
Console.WriteLine (ex);
}
Robert
More information about the Mono-list
mailing list