Rui,
Sorry for any inconvenience we brought to you. I understand your feelings and I will try my best to solve your issue.
We updated the obfuscation strategy from February 15th in Dev Branch. (The related version is 4.5. 107.0). We tested a lot before releasing this daily build package, maybe not as comprehensive as the major public release test, but we confirmed there are no public API changes and we only update the obfuscation for the internal codes, we don’t want to bring any breakings for the users.
For your scenario, one thing I’m not sure is even before the obfuscation updating, the serialized string is not “correct”. For example, use the same code as following:
static void Main(string[] args)
{
PointShape p = new PointShape(90, 80);
DataContractJsonSerializer serialier = new DataContractJsonSerializer(p.GetType());
MemoryStream stream = new MemoryStream();
serialier.WriteObject(stream, p);
byte[] bytes = stream.ToArray();
Console.WriteLine(Encoding.UTF8.GetString(bytes, 0, (int)stream.Length));
}
With the Assembly 4.5.0.0, we will get the string below:
{"xc6eb2ada450740a4":null,"xd3ffb967b3c25e70":"cbc89317-1564-42bd-bdf1-50a693d02f54","x901da2c3f210765e":0,"x93e3b47115896f10":90,"xa75f91922911cac0":80}
With the Assembly 4.5.119.0, we will get the following string instead.
{"ABU=":"cf11a8c9-616d-4563-b1cf-315b0898def3","wRY=":null,"xE4=":90,"xU4=":80,"xk4=":0}
We saw the obfuscated name in the serialized string is because the PointShape doesn’t support DataContract Serializing (the class is not marked as [DataContract] and the properties are not marked as [DataMember]). So when we use DataContractJsonSerializer it will return the names of the internal variables which are obfuscated instead of the names for the public properties (Marked as [DataMember]) which are constant. (We didn’t support DataContract Serializing I remember is because some limitation about polymorphism, we will have another look if that limitation still exists and if we can add it).
If the new obfuscating strategy hurts you, does that mean you were parsing the serialized strings with the old assembly, for example if it’s “x93e3b47115896f10” it means x in your code while if it is “xa75f91922911cac0”, it really means y? So when it now becomes “xE4=” it breaks the codes.
If that’s your scenario, I’m sorry for the breakings but at the same time, I’m afraid it’s not very good to use the obfuscated names directly. As you said, it would become obsolete and erroneous. A better way is to do the implementation ourselves like the code I provided in the message above. If that’s not your scenario, could you please let me know in detail, like what class/properties do you need for serialization, what’s the code which works before but not working now, etc.?
Rui, I know you are advanced with Map Suite and we are inspired from many of your thought through the forum, we really appreciate it. I’m really sorry that you are suffering from this update and please let me know what we can do to help you, we will try the best.
Thanks,
Ben