I have the following class with some auto-implemented properties (some properties were omitted).
[Serializable]
public class SessionInfo
{
public string UserLogin { get; set; }
public bool MustChangePassword { get; set; }
public DateTime PasswordExpirationDate { get; set; }
}
After the obfuscation, the automatic fields are renamed like this:
[Serializable]
public class SessionInfo
{
[CompilerGenerated] private string A;
[CompilerGenerated] private bool A;
[CompilerGenerated] private DateTime A;
public string UserLogin { get; set; }
public bool MustChangePassword { get; set; }
public DateTime PasswordExpirationDate { get; set; }
}
This is causing that the BinarySerialization fails while deserialization. Apparently, it can't determinate the right field because all are named the same.
This is the exception thrown:
System.ArgumentException. The object of type 'System.DateTime' cannot be converted to type 'System.Boolean'.
[Serializable]
public class SessionInfo
{
public string UserLogin { get; set; }
public bool MustChangePassword { get; set; }
public DateTime PasswordExpirationDate { get; set; }
}
After the obfuscation, the automatic fields are renamed like this:
[Serializable]
public class SessionInfo
{
[CompilerGenerated] private string A;
[CompilerGenerated] private bool A;
[CompilerGenerated] private DateTime A;
public string UserLogin { get; set; }
public bool MustChangePassword { get; set; }
public DateTime PasswordExpirationDate { get; set; }
}
This is causing that the BinarySerialization fails while deserialization. Apparently, it can't determinate the right field because all are named the same.
This is the exception thrown:
System.ArgumentException. The object of type 'System.DateTime' cannot be converted to type 'System.Boolean'.