|Dotfuscator > Understanding Protection with Dotfuscator > Building and Debugging Obfuscated Applications > Incremental Obfuscation|
Incremental obfuscation allows you to keep a consistent naming scheme across Dotfuscator runs for your application. By referencing a name mapping file, types and members can be consistently renamed over time. Consistent renaming is desirable in multiple scenarios, including the redistribution of a subset of files that constitute a dependant group, and sequential obfuscation of assemblies in a resource constrained environment. Appropriate utilization of this feature offers the additional benefit of more rapid obfuscation, when only some of the assemblies in a project need to be redistributed.
Consider a scenario where you have used Dotfuscator on your application and distributed that application to your customers. Now you would like to make changes to one of the assemblies and provide it as an update. A naive re-execution of Dotfuscator upon your application would likely rename your legacy classes and methods in a different way, forcing you to redistribute the entire application to your customers. Dotfuscator’s incremental obfuscation allows you to keep the same names so you can release the changed assembly.
Incremental obfuscation is useful in sequential build scenarios by allowing the obfuscation of large projects to be broken down into smaller, more manageable groups of assemblies. A hypothetical project consisting of three files,
C could be built as follows:
C.dll could be obfuscated initially, then
B.dll could be incrementally obfuscated using the map file from
C.dll, and finally
A.exe could be obfuscated using the map file from
Incremental obfuscation requires an input mapping file containing the names that need to be reused. The format is the same as the output mapping file that Dotfuscator produces after every run. A best practice is to save a copy of the output mapping file in a safe place (e.g. in version control) for every released build of your application. The file can then be used as an input mapping file if an incremental update should ever be necessary.
When performing a run using incremental obfuscation, Dotfuscator must have access to all the application’s assemblies, although it is not required that all the assemblies be included in the project. They only need to be discoverable by the same probing rules used by Dotfuscator to locate referenced assemblies.