How can I prevent a auto implemented property from being serialized by the binary formatter? The [NonSerialized] attribute can only be used with fields. And the field is hi
It's not possible for auto implemented properties. Consider folowing:
This behavior is "by design". The decision at the time auto-properties were implemented was that they would work in the "common case" which among other things means no attributes on the generated field. The idea behind that is keeping them simple and not slowly mutating them into full properties. So, if you need to use the NonSerialized attribute full properties are the way.
(http://social.msdn.microsoft.com/Forums/en-US/vcsharp2008prerelease/thread/2b6eb489-122a-4418-8759-10808252b195)