title: BinaryFormatter ignore assembly version
body: <p>I have the following method to generate a hash of an object. It works pretty good! But when I change the version of the assembly, the hash is changing even when the object is the same.</p>
  
  <pre><code>public static string GetHash(Object item)
  {
      MemoryStream memoryStream = new MemoryStream();
      BinaryFormatter binaryFormatter = new BinaryFormatter();
      binaryFormatter.Serialize(memoryStream, item);
      binaryFormatter.AssemblyFormat = FormatterAssemblyStyle.Simple;
  
      HashAlgorithm hashAlgorithm = new MD5CryptoServiceProvider();
      memoryStream.Seek(0, SeekOrigin.Begin);
  
      return Convert.ToBase64String(hashAlgorithm.ComputeHash(memoryStream));
  }
  </code></pre>
  
  <p>How is it possible to ignore the assembly version?</p>