帮助我的C#程序......... + _ + !!! [英] Help my C# program............+_+!!!

查看:72
本文介绍了帮助我的C#程序......... + _ + !!!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在程序集"WindowsFormsApplication4,版本= 1.0.0.0,区域性=中性,PublicKeyToken = null"中的类型"WindowsFormsApplication4.MessageModel"未标记为可序列化"...如何解决此问题我是初学者.

"Type 'WindowsFormsApplication4.MessageModel' in Assembly 'WindowsFormsApplication4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable".....How can I solve this problem?I'm a beginner.

"

"

推荐答案

基于您所写的内容,我假设您正在尝试以此序列化MessageModel类型的对象方法.问题是该对象不可序列化,因此您需要通过在类定义中添加标签[Serializeble]使其可序列化.

Based on what you wrote, I assume you are trying to serialize an object of the type MessageModel with this method. The problem is that this object is not serializable so you need to make it serializable by adding the tag [Serializeble] to the class definition.

示例:

[可序列化]
公共类MessageModel  {...}

[Serializable]
public class MessageModel {...}


这篇关于帮助我的C#程序......... + _ + !!!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆