using System.Runtime.Serialization.Formatters.Binary; 为什么不能引用,            IFormatter bf = new BinaryFormatter();//产生二进制序列化格式--这里无法实例化,
要怎么样把webservice 中序列化的数据在winform中反序列化

解决方案 »

  1.   

    项目里要引用该dll,你引用了吗?
      

  2.   

    我在引用中引用了 System.Runtime.Serialization
      

  3.   

    using System.Runtime.Serialization.Formatters.Binary;
    这行都报错,报什么错? 这是在 mscorlib.dll 中的,都不需要引用
      

  4.   

    错误 1 命名空间“System.Runtime.Serialization”中不存在类型或命名空间名称“Formatters”(是缺少程序集引用吗?) D:\My Documents\Visual Studio 2008\Projects\ChiangsSendOrd\ChiangsSendOrd\ChiangsSendOrd\Common\BusinessClass.cs 8 36 ChiangsSendOrd
      

  5.   

    必须引用,这个序列化类是在另一个dll中的。
    这是我的计算机里面显示的位置,4.0的,请参考:
    C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Runtime.Serialization.dll
      

  6.   

    晕,搞错了,项目中有这个引用还以为是和那个相关的,原来是WCF专用的,抱歉。
      

  7.   

     BinaryFormatter bFormat = new BinaryFormatter(); 
    IFormatter bf = new BinaryFormatter();
    那这个怎么实例化出来呢
      

  8.   

    你先去掉和这相关的代码,让程序生成通过,然后随便在某个方法里加上一行
    BinaryFormatter bFormat = new BinaryFormatter();  
    看看 BinaryFormatter 是不是有波浪线,右键点在波浪线上,弹出的菜单中有没有“解析”?