Dotfuscator User's Guide
Dotfuscating the ASP.NET Output

The sample contains a sample Dotfuscator configuration file that demonstrates using exclusion rules to handle items referenced in an aspx file that are define in the code-behind assembly. This file is named asp_config.xml and can be located in the same directory as the rest of the samples. The section of the file that excludes these references is:

ASP.NET Directory
Copy Code
   <type name="DotfuscatorASP.Sample">
    <field name="CountLabel"/>

The <renaming> tag indicates that the exclusion rules contained within pertain specifically to identifier renaming, as opposed to other Dotfuscator features which can also be selectively turned on or off.

The <excludelist> tag defines a list of items which must be excluded from the renaming process. The <type name="DotfuscatorASP.Sample"> tag instructs Dotfuscator to exclude the class name "DotfuscatorASP.Sample" from the renaming process. Note that this only refers to the class name itself. All methods of the "Tester" class are still eligible for renaming. This is required since the aspx file inherits from this class. The <field name="CountLabel"/> tag instructs Dotfuscator to exclude the server-side label control that displays the page load count.

Executing the run.bat file will run Dotfuscator with this configuration file. The output of this process is a DotfuscatorASP.dll assembly in the "output" subdirectory. This location can be controlled by modifying the following section in the configuration file:

Outut Directory
Copy Code
  <file dir="output" />

Executing the deploy.bat file will copy the obfuscated assembly into the bin directory that will be searched by the web server. This will overwrite the non-obfuscated assembly.

Visiting the website with the browser verifies that Dotfuscator correctly excluded the required items from the renaming process. Note that the load count has been reset to the default value indicating that IIS has reloaded the new assembly.



© 2017 PreEmptive Solutions, LLC. All Rights Reserved.