Search code examples
vb.netapp-configobfuscationdeobfuscationdotfuscator

Dotfuscator : Error after obfuscation


I am using dotfuscator to obfuscate my vb.net application(myapp.exe). But i am getting error while running the obfuscated file.

Below is the error when i open the exe which is obfuscated.

"The settings property 'Import' was not found. ImportSetting"

My application uses .config(myapp.exe.config) file which has setting like below

<userSettings>
    <myapp.My.MySettings>
        <setting name="Import" serializeAs="String">
            <value>True</value>
        </setting>
    </myapp.My.MySettings>
</userSettings>

If i don't obfuscate then application works fine. The error comes only if i obfuscate the my application.

Procedure i follow during obfuscation:

First i open create new project in dotfuscator.

In add input assembly i add myapp.exe and myapp.vshost.exe file from the bin folder of my project.

In build menu i select destination directory and click on build.

Now obfuscated file will be generated which i will use.

So please help me to solve this error.


Solution

  • Note that running the obfuscator will rename everything to hide it's purpose. See here, http://msdn.microsoft.com/en-US/library/ms227212(v=vs.80).aspx.

    My guess is that your <myapp.My.Settings> would have to be changed to the obfuscated name. I'm not sure how you would determine that however.

    Edit: It looks like dotfuscator outputs a map.xml file that specifies all the stuff that was renamed. You should be able to lookup myapp and see what it got renamed to, then update the .config file.