Serializing a Generics Dictionary?

  • Thread starter Thread starter Benton
  • Start date Start date
B

Benton

Hi there,

I could serialize a class until I added this member to it:

private Dictionary<string><TableMapper> = new
Dictionary<string><TableMapper>();

The class has the [Serializable()] attribute, but now it won't serialize.

Does any one know of a code sample that shows how can this be done? Any
workarounds?

Best Regards,

-Benton
 
Benton,

Are you sure the TableMapper has the serializable attribute? When you
say it won't serialize, what do you mean? Is an exception thrown?

Also, your syntax is wrong, it should be:

private Dictionary<string, TableMapper> myVariable = new Dictionary<string,
TableMapper>();
 
Back
Top