title: How do I remove a serialized field correctly in C#?
body: <p>I save data with a serialized class ,now I want to remove a filed member that no longer necessary ,but the old version has been already serilized as a file,how can I prevent a exception when the new version deserialized from the file?</p>
  
  <p>By the way,this C# is used in Unity3d,mono version</p>
  
  <pre><code> [Serializable]
   public class UserModel {
   // old version 
       Dictionary&lt;string,int&gt; readyToRemoveDict;
   }
   [Serializable]
   public class UserModel {
   //new version 
       //Dictionary&lt;string,int&gt; readyToRemoveDict;
   }
  </code></pre>
  
  <p>//In gameManager ,that's how I saved it</p>
  
  <pre><code> public void SaveData()
   {
       BinaryFormatter bf = new BinaryFormatter();
       FileStream file  = File.Create(Application.persistentDataPath + "/user.db");
  
       bf.Serialize(file,userModel);// this is the UserModel
       file.Close();
   }
  </code></pre>
  
  <p>I try add <code>[OptionalFiled]</code> but still not an exception</p>