[Serializable] for class inside class
-
Hi, I have some Problems with Serialization: I have a class B that is inside a class A:
public class A { [Serializable] public class B { public int Number; } }
When I try to serialize/deserialize it with the XML Serializer it does not work. Is it possible to serialize a class that is inside a class (so I have to search the bug elsewhere) or is it impossible (so I have to change the structure of the classes)? Thanks Roland
Hi! I'm a signature virus. Copy me into your sig file and help me spread!
-
Hi, I have some Problems with Serialization: I have a class B that is inside a class A:
public class A { [Serializable] public class B { public int Number; } }
When I try to serialize/deserialize it with the XML Serializer it does not work. Is it possible to serialize a class that is inside a class (so I have to search the bug elsewhere) or is it impossible (so I have to change the structure of the classes)? Thanks Roland
Hi! I'm a signature virus. Copy me into your sig file and help me spread!
OK, found the Problem: My class contains an IPAddress that can not be serialized by the XML Serializer because there is no default constructor. I only looked if the Attribute Serializable is set... I tested and saw that with a simple class like the onein my example there is no problem with serializing a class inside a class... Greets Roland
Hi! I'm a signature virus. Copy me into your sig file and help me spread!