Вопрос

i am working on network application, and im sending this object from client to server.. at rcving i get an error.. this is my class of which object im sending

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace DrawingClient
{
    [Serializable]
    class myClass
    {
        public List<Point> points = new List<Point>();
    }
}

and at rcving exactly where im de serializing the object.. im getting this exception.. Unable To Find Assembly drawing client, version=1.0.0.0, Culture=neutral PublicKeyToken=nulland i have all the assemblies at both server and at client end.. im testing it on my localhost.. mean both client and server are at localhost.. and same namespaces reffered in both applications.. im using tcpclient and tcplistener..

Это было полезно?

Решение

i made a dll in which i placed this class, and than referenced that dll in my Project at both ends and problem is solved..

actually when working with binary serialization assembly information also travels like my project name was rummykhan and my class name of which object i was serializing was book so the assembly information now include rummykhan.book and at client side assembly information is rummykhanclient.book so it was not deserializing.. when i made a dll and referenced it to both ends now assembly information is same and now its working. PS another part of information was also traveling along that was version information.. which we can control from the properties of the project.. and it must be same also..

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top