AnsweredAssumed Answered

Implementing Persistence in an Add-in - deserialization does not work

Question asked by golden_jubilee on Aug 21, 2012
Latest reply on Aug 22, 2012 by golden_jubilee
Hi,

I followed the LogExtension example http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Sample_Persisting_data_by_implementing_an_extension_using_add_ins/0001000004m1000000/

and I have the some problem with the binaryFormatter and the SerializationHelper

 protected override void OnSave(Stream outStrm)         {             base.OnSave(outStrm);              //PersistenceHelper.Save<SerializableObserveableCollection<ESRI.ArcGIS.Carto.ILayer>>(outStrm, availableLayer);             var bf = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();              //bf.Serialize(outStrm, availableLayer);             PersistenceHelper.Save<ObservableCollection<Layer>>(outStrm, availableLayer);         }          protected override void OnLoad(Stream inStrm)         {             base.OnLoad(inStrm);              //SerializableObserveableCollection<ESRI.ArcGIS.Carto.ILayer> o = new SerializableObserveableCollection<ESRI.ArcGIS.Carto.ILayer>();              var bf = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();              availableLayer = new ObservableCollection<Layer>();             //availableLayer = (ObservableCollection <Layer>) bf.Deserialize(inStrm);             PersistenceHelper.Load<ObservableCollection<Layer>>(inStrm, ref availableLayer);         }


The OnSave methods seems to work fine, but the Load call returns with:

Unable to find assembly 'MCDA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

According to "the internet" this is usually the case if two different applications(assemblies) try to work on the same data, which is not the case.

I have no idea how to solve this...

Outcomes