Can strong names cause problems with serializing objects in C #?

I serialize some configuration objects and store the result bytes in the database.

new BinaryFormatter().Serialize(memoryStream, instance);
Convert.ToBase64String(memoryStream.ToArray());

These objects will be deserialized later.

new BinaryFormatter().Deserialize(memoryStream);

It is possible that the application has several new build versions during deserialization. In general, this works well, but sometimes I get a file upload exception: "The installed assembly manifest definition does not match the assembly reference." All assemblies work with a strong name, maybe a problem, and how can I avoid this problem?

thanks for the help

+3
source share
2 answers

, BinaryFormatter ( ) - ; BinaryFormatter ( ):

  • (shacks, / ... /)
  • ( - !)
  • .NET( , - - )

My : ... , .

. XmlSerializer DataContractSerializer . , protobuf-net . BinaryFormatter, , ( ) .. , .

+2

, WCF . , , .

:

A: 2 Widget,

B: 1 Widget,

C: 2 Widget,

A B, Widget, B C, Widget, C Description, A. B , , "", , .

, WCF proc.

. wcf.

0

Source: https://habr.com/ru/post/1708633/


All Articles