G
Guest
I have a HashTable which has keys and values which are defined in a Class
CRoutePoint.
I have [Serializable] at the beginning of the CRoutePoint class.
CRoutePoint is in the NameSpace "MissionLibrarySuiteIII".
For example:
Hashtable m_hshPntsRoute = new Hashtable(NUM_NAV_POINTS);
CRoutePoint rptModified = new CRoutePoint() ;
....
m_hshPntsRoute.Add(rptModified.Identifier, rptModified);
I can Serialize the Hashtable using the following code:
MemoryStream memStream = new MemoryStream();
try
{
BinaryFormatter b = new BinaryFormatter();
b.Serialize(memStream, m_UC.RteHashPoints);
When I Desreialize the HashTable using the following code:
BinaryFormatter b = new BinaryFormatter();
long len = reader.ReadInt64();
for ( long i = 0; i < len; i++ )
{
memStream.WriteByte( reader.ReadByte() );
}
// reset to the begining of the memory image
memStream.Seek( 0, SeekOrigin.Begin );
m_UC.RteHashPoints = (Hashtable) b.Deserialize(memStream);
I get the Exception: {"Cannot find the assembly MissionLibrarySuiteIII,
Version=1.0.1.0, Culture=neutral, PublicKeyToken=null." } System.Exception
How can I make the assembly MissionLibrarySuiteIII visible for
Deserialization?
CRoutePoint.
I have [Serializable] at the beginning of the CRoutePoint class.
CRoutePoint is in the NameSpace "MissionLibrarySuiteIII".
For example:
Hashtable m_hshPntsRoute = new Hashtable(NUM_NAV_POINTS);
CRoutePoint rptModified = new CRoutePoint() ;
....
m_hshPntsRoute.Add(rptModified.Identifier, rptModified);
I can Serialize the Hashtable using the following code:
MemoryStream memStream = new MemoryStream();
try
{
BinaryFormatter b = new BinaryFormatter();
b.Serialize(memStream, m_UC.RteHashPoints);
When I Desreialize the HashTable using the following code:
BinaryFormatter b = new BinaryFormatter();
long len = reader.ReadInt64();
for ( long i = 0; i < len; i++ )
{
memStream.WriteByte( reader.ReadByte() );
}
// reset to the begining of the memory image
memStream.Seek( 0, SeekOrigin.Begin );
m_UC.RteHashPoints = (Hashtable) b.Deserialize(memStream);
I get the Exception: {"Cannot find the assembly MissionLibrarySuiteIII,
Version=1.0.1.0, Culture=neutral, PublicKeyToken=null." } System.Exception
How can I make the assembly MissionLibrarySuiteIII visible for
Deserialization?