开发者

Visual studio designer: type is not marked as serializable

开发者 https://www.devze.com 2023-01-11 08:59 出处:网络
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'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;

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号