How do I Deserialize an Object from different assembly?

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
Hello! I am having the exact same problem. Have you gotten a fix for this at this time?

I would greatly appreciate it if you could pass it along.

Thanks
Tony D
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?

User submitted from AEWNET (http://www.aewnet.com/)
 
Back
Top