I have a web application I am trying to obfuscate portions of it, but use library mode so that all the public portions of the application should appear with names unchanged so it is accessible to the web. So I am trying to obfuscate some parts and not others. The sites I have visited appear to support it but I am getting an exception:
Click Here
Here is my Dotfuscator.xml file which is on the root of the project.
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE dotfuscator SYSTEM "http://www.preemptive.com/dotfuscator/dtd/dotfuscator_v1.1.dtd">
<dotfuscator version="1.1">
<propertylist>
<property name="SourceDirectory" value="This Path Will Be Replaced By Visual Studio" />
<property name="SourceFile" value="This Filename Will Be Replaced By Visual Studio" />
</propertylist>
<global>
<!--set library option -->
<option>library</option>
</global>
<trigger>
<filelist>
<file dir="${SourceDirectory}\" name="${SourceFile}" />
</filelist>
</trigger>
<output>
<file dir="${SourceDirectory}\Dotfuscator\" />
</output>
</dotfuscator>
Here are my post build events:
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\PreEmptive Solutions\Dotfuscator and Analytics Community Edition \dotfuscatorCLI.exe" /q /p=SourceDirectory=$(TargetDir),SourceFile=$(TargetFileName) $(ProjectDir)Dotfuscator.xml
copy $(TargetDir)Dotfuscator\$(TargetFileName) $(TargetDir)$(TargetFileName)
rmdir /S /Q $(TargetDir)Dotfuscator
I get this error though, so there is something wrong with the obfuscation:
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
Most likely causes:
A default document is not configured for the requested URL, and directory browsing is not enabled on the server.
I believe this is due to the obfuscator obfuscating too much, eg public variables and methods getting obfuscated. This should be possible, it just isn't working for me. If anyone has a good procedure for obfuscating web code that doesn't break things that would be good.