Now that I am finished with the port to VS2005 / .NET 2.0, I wanted to point out a few final issues I came across. Note that we use the Preemptive Dotfuscator v3.0 here, but the obfuscation issues likely apply to other obfuscators as well:
New files in ASP.NET 2.0
As the compilation model for ASP.NET has changed a great deal, there are also some new files that you must deploy. Of course, this is not an issue if you use VS2005 to deploy directory to a web site, but if you are packaging up all of your files into an installer then make sure you include these new files:
- *.resx
- *.compiled
- PrecompiledApp.config
In particular, I have found that if the *.compiled and PrecompiledApp.config file are not in place, your global events will not get raised.
Obfuscation Issue #1: Don't rename __ASP
Exclude the __ASP namespace from the renamed. This is a new namespace that is generated by the compiler, so you need to exclude this in your Dotfuscator project file:
<renaming>
<excludelist>
. . .
<namespace name="__ASP" regex="false" />
. . .
</excludelist>
</renaming>
Note that there is also a new ASP namespace, but I did not have to exclude
this one because I was already excluding class names that are automatically
placed under this namespace.
Obfuscation Issue #2: Don't obfuscate multiple Web projects at onceBefore ASP.NET 2.0, it was possible to obfuscate multiple Web projects at the same time (as long as all of the namespaces are unique across projects). The new namespaces that are generated by the compiler (i.e., ASP and __ASP) will cause a conflict during obfuscation. To solve this problem, you need to break up your obfuscations into multiple projects.
This last part is somewhat non-trivial (or at least a real hassle). I have written many nant scripts that take build output and assemble them into a directory for obfuscation, breaks up the Dotfuscator configuration file, runs multiple obfuscation runs, and finally reassembles the files into individual folders for release.
I am not going to blog on those specifics, but if you are interested in my solutions to these problems, feel free to contact me.