Dotfuscator User's Guide
Constant-Only Pruning

You may encounter situations where you may not wish to configure pruning on an assembly, but still wish to achieve some of the attack surface and assembly size reduction goals of pruning. In these cases, constant-only pruning is an ideal compromise. During constant-only pruning, Dotfuscator will only prune constant declarations (const fields) from the input assemblies. Unused types, methods, and fields will not be discovered, and will be propagated to the output assembly.

Constant-only pruning is safe to do in many situations where full pruning is not desired. During compilation, .NET compilers will replace references to const fields in code with the actual values of those fields. The constant declarations remain in the assembly only to support being referenced by external assemblies or being accessed via reflection. If you do not need to support these scenarios, it is generally safe to enable constant-only pruning.



© 2017 PreEmptive Solutions, LLC. All Rights Reserved.