Search code examples
c#obfuscationeazfuscator

Exclude a namespace from Obfuscation with Eazfuscator


I have a DotNetBrowser license in my project, and it is bound to my namespace. However, Eazfuscator is obfuscating the namespace.

I tried to prevent this by adding the following lines(one at a time) to AssemblyInfo.cs:

[assembly: Obfuscation(Feature = "namespace(MyNamespace)", Exclude = true)]
[assembly: Obfuscation(Exclude = true, Feature = "namespace('MyNamespace'):-rename")]

I also tried with Exclude = false, but my namespace still gets obfuscated. Can anyone tell me how to prevent my namespace from being obfuscated?


Solution

  • According to the document of eazfuscator, it removes the namespaces of renamed types, but you can add the namespaces back by

    [assembly: Obfuscation(Feature = "type renaming pattern 'MyNamespace'.*", Exclude = false)]
    

    or

    [Obfuscation(Feature = "type renaming pattern 'MyNamespace'.*", Exclude = false)]
    class MyClass