BinaryFormatter无法反映类型 [英] BinaryFormatter can't reflect a type

查看:45
本文介绍了BinaryFormatter无法反映类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好...
请看一下这段代码:

hey guys...
please take a look on this piece of code:

FileStream fileStream = new FileStream(fileName, FileMode.Create);
(new BinaryFormatter()).Serialize(fileStream, toSave);
fileStream.Flush();
fileStream.Close();



我在第二行出现错误-反映类型为"myType"的错误-
"myType"是可预测的[Serializable];
在"myType"中,我有一个类型为"ZedGraph.LineItem"的属性,我认为这是原因. 那我该怎么知道...
请帮助...



I have an error on second line -There was an error reflecting type "myType"-
"myType" is predictably [Serializable];
in "myType" I have a property of type "ZedGraph.LineItem" and I think it''s the cause.
so what should I do know...
please help...

推荐答案

也许这里的代码可以解决您的问题:
http://stackoverflow.com/questions/2861722/binary-通过字符串进行序列化和反序列化 [
Perhaps the code here sould solve your problem:
http://stackoverflow.com/questions/2861722/binary-serialization-and-deserialization-without-creating-files-via-strings[^]


这篇关于BinaryFormatter无法反映类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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