Quantcast
Channel: Obfuscar, The Open Source Obfuscation Tool for .NET Assemblies
Viewing all articles
Browse latest Browse all 249

Closed Unassigned: BinarySerialization and Auto-implemented Properties [14]

$
0
0
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'.


Viewing all articles
Browse latest Browse all 249

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>