Code: Select all
public static dynamic testAnonymousType()
{
var obj = new { Name = "John", Age = 30 };
return obj;
}
Since anonymous classes cannot apply attributes, and applying [Obfuscation(Feature = "renaming", Exclude = true)] for this method does not work, is there a way to prevent such renaming? Or is disabling renaming globally the only solution?
(add [assembly: Obfuscation(Feature = "renaming", Exclude = true)]
and add [Obfuscation(Feature = "renaming", Exclude = false, ApplyToMembers = true)] each class -> this works)