Unable to find assembly 'ssdsdsd, Version=, Culture=neutral, PublicKeyTok

Discussion created by ehsan_ro on Dec 3, 2011
Latest reply on Dec 5, 2011 by ehsan_ro

I am trying to develop a code using ArcMap Add In template in VS2010
I have a serializeable struct in c# which I would like to serialize and then deserialize
I have written the following code to serialize this struct.

        public struct Test
            public double a;
            public double b;

        public void Serialize(Test obj)
            Stream file = File.Open(@"c:\tt.dat", FileMode.Create);
            BinaryFormatter b = new BinaryFormatter();
            b.Serialize(file, obj);

This code works well but when I try to deserialize the same struct in the same project it gives me this error

"Unable to find assembly 'SerializeGIS, Version=, Culture=neutral, PublicKeyToken=null'."} System.Exception {System.Runtime.Serialization.SerializationException}

This is the deserializing function

        public Test DeSerialize(string Name)
            Test Obj = new Test();

                Stream  file = File.Open(Name, FileMode.Open);
                BinaryFormatter  b = new BinaryFormatter();
                Obj = (Test)b.Deserialize(file);  //This is the line which propagate the exception
            catch (Exception)
            return Obj;

I have put both functions in a windows form application template in c# and they work perfectly but when I use them in ArcMap Add In project it raises the mentioned error

This error gives me at least 20 gray hairs today.

I would be appreciated if someone could shed some light on it.