各位大虾,小弟有一个client 端程序 和 一个 server端程序,从client端将一个结构体数组序列化后传给server端,然后server端进行反序列化,想得到这个结构体数组,但是反序列化时报错:
“无法找到程序集 ProcessWatch, Version=1.0.2412.32565, Culture=neutral, PublicKeyToken=null。” 其中,ProcessWatch是我的解决方案名称。如下:client端://序列化
System.IO.MemoryStream memStream = new System.IO.MemoryStream();
BinaryFormatter temp = new BinaryFormatter();
temp.Serialize(memStream,this.arrayStruct); //this.arrayStruct就是我那个结构体数组
memStream.Position = 0;
memStream.Read(this.byteArray,0,(int)memStream.Length);//this.byteArray就是我要传输用的 byte数组//传递
socket.BeginSend(this.byteArray,0,this.byteArray.Length,0,new AsyncCallback(SendCallback),sClient);server端:
//反序列化
System.IO.MemoryStream memStream = new System.IO.MemoryStream();
memStream.Write(buffer,0,buffer.Length);//buffer就是client端传过来的byte数组
memStream.Position = 0;this.arrayStruct = (InforServer[])temp1.Deserialize(memStream); //this.arrayStruct是和client端同样定义的结构体数组就在这最后一句报错:“无法找到程序集 ProcessWatch, Version=1.0.2412.32565, Culture=neutral, PublicKeyToken=null。”
其中,ProcessWatch是我的解决方案名称。各位大虾,这是怎么回事啊,序列化和反序列化的操作,我在同一个程序中已经验证是可以的,为什么分成两个程序进行就错误了?难道是传输过程中有变化吗? 救命啊!!!
“无法找到程序集 ProcessWatch, Version=1.0.2412.32565, Culture=neutral, PublicKeyToken=null。” 其中,ProcessWatch是我的解决方案名称。如下:client端://序列化
System.IO.MemoryStream memStream = new System.IO.MemoryStream();
BinaryFormatter temp = new BinaryFormatter();
temp.Serialize(memStream,this.arrayStruct); //this.arrayStruct就是我那个结构体数组
memStream.Position = 0;
memStream.Read(this.byteArray,0,(int)memStream.Length);//this.byteArray就是我要传输用的 byte数组//传递
socket.BeginSend(this.byteArray,0,this.byteArray.Length,0,new AsyncCallback(SendCallback),sClient);server端:
//反序列化
System.IO.MemoryStream memStream = new System.IO.MemoryStream();
memStream.Write(buffer,0,buffer.Length);//buffer就是client端传过来的byte数组
memStream.Position = 0;this.arrayStruct = (InforServer[])temp1.Deserialize(memStream); //this.arrayStruct是和client端同样定义的结构体数组就在这最后一句报错:“无法找到程序集 ProcessWatch, Version=1.0.2412.32565, Culture=neutral, PublicKeyToken=null。”
其中,ProcessWatch是我的解决方案名称。各位大虾,这是怎么回事啊,序列化和反序列化的操作,我在同一个程序中已经验证是可以的,为什么分成两个程序进行就错误了?难道是传输过程中有变化吗? 救命啊!!!
解决方案 »
- C#,在没有虚拟打印机的情况下,如何直接打印到文件,不输出到打印机
- 做一个Asp.net程序,关于动态创建CheckBox控件后,改变CheckBox的选择状态,显示相应提示信息的问题
- 关于VS2010 C#读取App.Config的问题
- 请大家来帮我找错误!
- 如何修改WinForm下DataGrid的标题?
- 怎样从流里读取图片进行 识别啊? 我用的是次时代。
- 在pictureBox中的图像的放大、缩小、平移等问题啊?
- 如何用C#读取一个XML文件,并解析获取其中的数据。
- 十进制数(<6000)如何用两个Byte表示?
- 如果指定把一个应用程序放在所有程序的最前面
- 急!!!!!!水晶报表的问题
- 如何判断时间段属于某一天的上午还是下午?
[Serializable]
public struct InforServer
{
public string strType;
public string strName;
public string strState;
public string strErrorDescription; public InforServer(string strType,string strName,string strState,string strErrorDescription)
{
this.strType = strType;
this.strName = strName;
this.strState = strState;
this.strErrorDescription = strErrorDescription;
}
}
public InforServer[] arrayStruct = new InforServer[50];