myByte – all bytes are zero
a = “AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==”
var memoryStream = new MemoryStream();
var binaryFormatter = new BinaryFormatter();
binaryFormatter.Serialize(memoryStream, m_workspace.ListPlatforms.ToArray());
myByte = new byte[memoryStream.Length];
memoryStream.Seek(0, SeekOrigin.Begin);
memoryStream.Write(myByte, 0, myByte.Length);
string a = System.Convert.ToBase64String(myByte);
what could be the reason
You’re calling
Writewhen I suspect you meant to callRead. In other words, you’re writing from a newly created (and thus full-of-zeroes) array to theMemoryStreamwhich has your serialized data in. UsingReadinstead ofWritewill read into the array from the stream.It would be simpler to call
ToArraythough: