Visual studio designer: type is not marked as serializable
I'm working with Visual studio 2008.
I have a form inherited from DockContent class (Weifen Luo dock panel suite if you ever heard about that library).
I can add another controls on that form. But when I tried to add an event handler via Property开发者_JAVA百科 tab, Visual studio generated an exception "type is not marked as serializable".
What should I do to fix that problem ?
I'm guessing the class you are working with has the [Serializable] attribute. Because events are non-serializable, you will have to mark them this way.
[field:NonSerialized] private EventHandler myEvent;
精彩评论