How to make a class public
Hello there!
I have a problem with serialize a class and sent it via sockets. I have a separate server and client project. I have a Message class that I use when communicating:
<Serializable()> Public Class Message
â¦
End Class
Code to send:
Dim formatter As New BinaryFormatter()
formatter.Serialize(_stream, message)
Code to receive:
Dim message As Message = Nothing
message = formatter.Deserialize(_stream)
When receive/Deserialize a message a get an exception:
System.IO.FileNotFoundException: File or assembly name WChange (the server name), or one of its dependencies, was not found.
I have used âAssembly Binding Log Viewerâ and what itâs saying to me is that the message class is not available. The message class is declared in exactly same way in both projects.
Help!?
Regards,
LOG: Processing DEVPATH.
LOG: DEVPATH is not set. Falling through to regular bind.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Post-policy reference: WChange, Version=1.0.1374.34952, Culture=neutral, PublicKeyToken=null
LOG: Attempting download of new URL file:///E:/ dotNet/SocketClient/bin/WChange.DLL.
LOG: Attempting download of new URL file:///E:/ dotNet/SocketClient/bin/WChange/WChange.DLL.
LOG: Attempting download of new URL file:///E:/ dotNet/SocketClient/bin/WChange.EXE.
LOG: Attempting download of new URL file:///E:/ dotNet/SocketClient/bin/WChange/WChange.EXE.
LOG: All probing URLs attempted and failed.
|