How to make a class public
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
Code to send:
Dim formatter As New BinaryFormatter()
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.
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.