Chapter 10, Work with Visual Studio Tools
#80 Obfuscate Your Code
inside” compiled assemblies. If this is alarming, it should be. After all, you
may have class libraries with highly confidential business logic—if that logic
were to fall into the wrong hands, you could lose your competitive advan-
tage. Luckily, Visual Studio contains a tool named Dotfuscator that you can
use to make sure that the output of a decompiler is as close to gibberish as
Create a Dotfuscator Project
To use the Dotfuscator, you’ll first need to create a project in Visual Studio
and compile it (in this case, I’ve created a project with a class named Simple-
Math). Then create a Dotfuscator Project for your assembly by following
these steps:
1. On the Visual Studio menu, click Tools
Dotfuscator Community Edi-
tion. This will start the Dotfuscator.
2. At the Select Project Type dialog box, choose Create New Project and
click OK. You’ll now see a tool with several tabs along the top
(Figure 10-25).
Although several tabs and numerous options can be configured in the
Dotfuscator, you need to configure two items at a minimum to create an
obfuscated assembly. They are the trigger file(s) and the build destina-
tion directory. Once these two options are set, you can save the Dotfus-
cator Project for use later. Dotfuscator Projects are saved in XML
Figure 10-24. Performance counters statistics

Get Visual Studio Hacks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.