I am trying to send an object over tcpclient from the server to a client and i get an error . First, here is the pack class :
[Serializable()]
public class pack
{
public int a;
}
here is the server's sending code(it's namespace is WindowsFormsApplication1) :
pack pachet = new pack();
pachet.a = 3;
IFormatter bformatter = new BinaryFormatter();
NetworkStream ntstream = tcpClient.GetStream();
bformatter.Serialize(ntstream, pachet);
and the client's 'translation' code(it's namespace is WindowsFormsApplication2) :
NetworkStream strm = client.GetStream();
IFormatter bformatter = new BinaryFormatter();
pack nettmp = (pack)bformatter.Deserialize(strm);
and the error is :
serializationException was unhandeled. Unable to find assembly 'WindowsFormsApplication1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Can someone tell me what the problem is?