How i exclude part of code being obfuscated by ConfuserEx?

Viewed 623

Im looking to how i can exclude a line of code in my project, but all i found is how to exclude a complete namespace, can you help me ?

1 Answers

.NET has an attribute called ObfuscationAttribute, which has an Exclude property.

The documentation for Exclude says:

Gets or sets a Boolean value indicating whether the obfuscation tool should exclude the type or member from obfuscation.

You should be able to add [Obfuscation(Exclude = true)] to the member(s) you want to exclude. If the obfuscator tool you're using properly respect this attribute (ConfuserEx should be respecting this AFAIK), it should get the work done.

Related