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

I followed the LogExtension example

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=, 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...