[Mono-dev] Issues with System.Random

Robert Jordan robertj at gmx.net
Wed Mar 17 11:40:34 EDT 2010


On 17.03.2010 16:33, Adrian Willenbücher wrote:
> Kornél Pál wrote:
>> You can use the OnDeserializedAttribute and NonSerializedAttribute
>> attributes.
>
> Unfortunately that doesn't allow me to incorporate the serialized state. Instead, I think I found a better solution by
> explicitly (de)serializing the object. It first tries to deserialize the object from the new version, and if that fails,
> from the old one. If anything doesn't work, the RNG will still be seeded and functional.
>
> 	public class Random : ISerializable

Implementing an interface is a breaking change of the API.
That's why Konél was mentioning OnDeserializedAttribute.

Robert



More information about the Mono-devel-list mailing list