Page 1 of 1

selective class member renaming with ObfuscationAttribute

Posted: Sat Dec 16, 2023 1:39 pm
by weloveayaka
Currently, the "Strip the debug information" option is a global setting that disables the renaming function. While we have numerous classes in our assembly, we only intend to rename the members of a select few.

When "Strip the debug information" is disabled, the [Obfuscation(Exclude = false, Feature = "renaming")] attribute doesn't function as intended. Is it possible to enable this attribute selectively for specific classes without enabling "Strip the debug information" and adding hundreds of [Obfuscation(Exclude = true, Feature = "renaming")] attributes?

Re: selective class member renaming with ObfuscationAttribute

Posted: Sat Dec 16, 2023 2:56 pm
by Admin
It seems you need something like this:

Code: Select all

[assembly:Obfuscation(Feature = "renaming", Exclude = true)]

[Obfuscation(Feature = "renaming", Exclude = false, ApplyToMembers = true)]
class Foo {
...

Re: selective class member renaming with ObfuscationAttribute

Posted: Sun Dec 17, 2023 5:31 am
by weloveayaka
Thank you! It works.