Please enter the text to find and press Search.
Sorry

An error occurred during search results load.

Custom Attributes Removal

.NET framework provides a set of custom attributes that allows to describe meta properties of a given class, field, property or method.

For example, Windows Forms and WPF visual designers use System.ComponentModel.DescriptionAttribute to find the textual descriptions for editable class properties. There are other use cases and they are numerous.

Eazfuscator.NET automatically prunes excessive meta attributes whenever possible. However you may prefer to remove all custom attributes with given conditions in some scenarios to achieve better obfuscation coverage.

Instructions on using the custom attributes removal

Suppose we want to remove System.ComponentModel.DescriptionAttribute from every class member of the assembly. Please follow the instructions below to achieve that.

  1. Open obfuscatable project inside the IDE
  2. Add new source file to the project and call it ObfuscationSettings.cs (for C#) or ObfuscationSettings.vb (for Visual Basic .NET). You may prefer to use another name instead of ObfuscationSettings.cs or ObfuscationSettings.vb
  3. Fill ObfuscationSettings.cs with the following content (C#):

    using System;
    using System.Reflection;
    
    [assembly: Obfuscation(Feature = "Apply to type *: apply to member *: remove custom attribute System.ComponentModel.DescriptionAttribute", Exclude = false)]

    For Visual Basic .NET, fill ObfuscationSettings.vb with the following content:

    Imports System
    Imports System.Reflection
    
    <Assembly: Obfuscation(Feature:="Apply to type *: apply to member *: remove custom attribute System.ComponentModel.DescriptionAttribute", Exclude:=False)> 
    

[Tip]Tip

You can use specific conditions to define the scope of custom attributes removal. See conditional obfuscation for details.

[Tip]Tip

You can specify any class name instead of System.ComponentModel.DescriptionAttribute.
Patterns are allowed too, for example: *.DescriptionAttribute

[Tip]Tip

Attribute literal at the end of the class name can be omitted, e.g. System.ComponentModel.Description will do the job too.

Sorry

An error occurred during page load.
You can try again or go back.