views:

39

answers:

1

I have a type that both implements ISerializable and defines a method adorned with the OnSerializingAttribute. I have noticed that ISerializable.GetObjectData is called before the OnSerializing callback. This seems wrong to me because it renders the OnSerializing callback redundant. After all, there's no point in making preparatory adjustments to an object's state after said state has already been written to the SerializationInfo object.

Has anyone come across this before and, if so, how did you get around the problem?

A: 

Scratch that - a breakpoint wasn't set. Everything is, in fact, working correctly.

Chris