selective class member renaming with ObfuscationAttribute

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?

It seems you need something like this:

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

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

Thank you! It works.