-2

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?

Community
  • 1
  • 1
sashaeve
  • 9,387
  • 10
  • 48
  • 61
  • seems like a joke to me, the comment about `.ToString()`. Ignore it. This is a duplicate of http://stackoverflow.com/questions/81674/how-to-check-if-an-object-is-serializable-in-c. – tenfour Aug 18 '10 at 07:53
  • @leppie. No, the sense of question is different. – sashaeve Aug 18 '10 at 07:54
  • But the question is the same... change your subject if that is not what you mean. – leppie Aug 18 '10 at 07:54
  • The person making that comment on the linked page is an IDIOT! He should remove his thumb from his rearend. – leppie Aug 18 '10 at 07:56

1 Answers1

1

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...

How to check if an object is serializable in C#

Community
  • 1
  • 1
Yves M.
  • 3,330
  • 14
  • 12