views:

41

answers:

1

Possible Duplicate:
How to check if an object is serializable in C#

Recently found the following sentence:

"Just to enhance, take a thumb rule, the object that support .ToString() are all serializable objects."

This looks like strange as all objects have .ToString() method so in this case all objects must be serializable. Is this sentence make sense?

Also is any rule to detect that specific object is serializable?

+1  A: 

If found this article helpfull on this topic:

http://msdn.microsoft.com/en-us/library/ms973893.aspx

The ToString() is not defined to serialize an object. You could implement a class that does have this behaviour but I don't think this would be a good idea.

And yep: already asked. Thought so...

http://stackoverflow.com/questions/81674/how-to-check-if-an-object-is-serializable-in-c

Yves M.