开发者

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;

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜