Use SmartAssembly custom attributes to specifically exclude parts of your code from obfuscation, pruning, sealing and error reporting.
Refer to documentation to learn more: https://documentation.red-gate.com/sa8/using-custom-attributes
SmartAssembly MSBuild task allows you to protect your assembly automatically during build.
Refer to documentation to learn more: https://documentation.red-gate.com/sa8/building-your-assembly/using-smartassembly-with-msbuild
Installed and activated version of SmartAssembly is required to run this...
More information