In Windows Forms, .NET Framework 4.0, I am trying to Serialize an instance of a class I wrote.
The class is marked as Serializable, but the form that uses the class
This is something you can run into with any JSON serialization, including Web API in MVC 4.
I found this post to be very helpful when I was getting a serialization except on a const int value. Any const value needs to be marked with the same attribute as in Nick Freeman's answer:
[field: NonSerializedAttribute]
const int iCantBeSerialized = 1;