Most protected applications behave like their unprotected versions, except for behavior introduced by configured Checks. However, some obfuscation settings can cause runtime errors and require manual configuration.
Smart Obfuscation can detect some potential problems through static analysis, but it cannot detect every runtime dependency.
Review Renaming
Runtime errors are frequently related to Renaming. For example, code may pass a string containing a method name to a reflection API. After Dotfuscator renames the method, the string still contains its original name and the call may fail. To resolve this type of problem, exclude the affected method from renaming.
For a detailed example, refer to Identify Renaming Exclusions.
Review Removal
Runtime errors can also occur when Removal is enabled, and static analysis cannot identify all code used at runtime. To prevent Dotfuscator from removing required code, configure the affected methods so that they are always included in the protected assembly.
Note: Removal and Root Check are not supported for MAUI in Linux environments.
Identify the Problematic Transform
To determine which transform causes the runtime error, test the application under the following conditions:
- Disable all obfuscation transforms.
- Enable Library Mode for all input assemblies.
- Disable Transform XAML for all input assemblies.
- Review the Renaming configuration.
For Renaming-related problems, verify the following:
- For dependency properties, exclude the property and all its backing methods from renaming.
- Determine whether the application works with the Property Exclusion Catch-All rule:
<type name=".*" regex="true">
<propertymember name=".*" regex="true"/>
</type>Review Build Warnings
Review all messages on the Warnings tab. If the Dotfuscator build produces warnings, the Config Editor displays them on a separate tab in the Build Output section.
Make sure that you understand and account for every warning before testing the protected application.
Capture Runtime Exceptions
Catch runtime exceptions and display their details in a message box to determine what is failing in the protected application.