Generic Serialization?

Tech-Archive recommends: Fix windows errors by optimizing your registry



The target language is .NET 2.0, so Generics are used.

The data that needs to be serialized is a name value pair where the
name is always a string, but the value can be anything that can be
serialized. The value can be an object that has the
SerializableAttribute, implements the ISerializable interface, or a
simple type like an int.

The data is being stored in a Dictionary Generic, what should the type
be of the value? If it is object, then a class that is not
serializable can be added to the collection. Is there any want of
forcing the type to be serializable and still handle basic types like
an int?

.