Hello
I'm using NetReactor to obfuscate a C# Project (Windows Service)
I don't want to obfuscate a some part of the code, I'm using ObfuscateAttribute witch the feature DeclarativeProtection from NetReactor that allow me to exclude some part of the code
This is What I'm doing
using System.Reflection;
public class MyClass
{
// Exclude this method from obfuscation
[Obfuscation(Feature = "renaming", Exclude = true)]
public void ProblematicMethod()
{
// Method implementation
}
}
I tried diferents ways but still dosen't work
[System.Reflection.Obfuscation(Feature = "renaming", Exclude = true)
[System.Reflection.Obfuscation(Feature = "obfuscate", Exclude = true)
[ObfuscationAttribute(Exclude=true, Feature="default",StripAfterObfuscation=false)]
[ObfuscationAttribute()]
Anyone know What I'm doing wrong
Thanks

Amira BedhiafiRank #601 · 4K reputationPosted Apr 10, 2025, 1:42 PM EDT
You need to correct Attribute syntax for NetReactor:
[Obfuscation(Feature = "renaming", Exclude = true)] [Obfuscation(Feature = "all", Exclude = true)] [Obfuscation(Feature = "protection", Exclude = true)]Verify that you're using the correct namespace. NetReactor might require its own attribute:
using NetReactor; [NetReactor.Obfuscation(Exclude = true)] Try applying the attribute at the class level if you want to exclude the entire class: [Obfuscation(Feature = "all", Exclude = true)] public class MyClass { // All members will be excluded }