ObfuscationAttribute.StripAfterObfuscation Propiedad

Definición

Obtiene o establece un valor Boolean que indica si la herramienta de ofuscación debe quitar este atributo tras el procesamiento.

public:
 property bool StripAfterObfuscation { bool get(); void set(bool value); };
public bool StripAfterObfuscation { get; set; }
member this.StripAfterObfuscation : bool with get, set
Public Property StripAfterObfuscation As Boolean

Valor de propiedad

true en caso de que una herramienta de ofuscación deba quitar el atributo tras el procesamiento; en caso contrario, false. De manera predeterminada, es true.

Ejemplos

En el ejemplo de código siguiente se muestra una ObfuscationAttribute cuya StripAfterObfuscation propiedad es false para que la herramienta de ofuscación no quite el atributo después de ofuscación. Es necesario especificar false para que la Exclude propiedad evite excluir MethodA la ofuscación, ya que el valor predeterminado de la Exclude propiedad es true.

Este código forma parte de un ejemplo más grande que se puede compilar y ejecutar. Vea la descripción de la clase ObfuscationAttribute.

[ObfuscationAttribute(Exclude=true, ApplyToMembers=false)]
public class Type2
{

    // The exclusion of the type is not applied to its members,
    // however in order to mark the member with the "default"
    // feature it is necessary to specify Exclude=false,
    // because the default value of Exclude is true. The tool
    // should not strip this attribute after obfuscation.
    [ObfuscationAttribute(Exclude=false, Feature="default",
        StripAfterObfuscation=false)]
    public void MethodA() {}

    // This member is marked for obfuscation, because the
    // exclusion of the type is not applied to its members.
    public void MethodB() {}
}
<ObfuscationAttribute(Exclude:=True, ApplyToMembers:=False)> _
Public Class Type2

    ' The exclusion of the type is not applied to its members,
    ' however in order to mark the member with the "default" 
    ' feature it is necessary to specify Exclude:=False,
    ' because the default value of Exclude is True. The tool
    ' should not strip this attribute after obfuscation.
    <ObfuscationAttribute(Exclude:=False, _
        Feature:="default", StripAfterObfuscation:=False)> _
    Public Sub MethodA()
    End Sub

    ' This member is marked for obfuscation, because the 
    ' exclusion of the type is not applied to its members.
    Public Sub MethodB()
    End Sub

End Class

Comentarios

Los atributos no se deben quitar si la biblioteca se incluirá como parte de otra aplicación y se ofusca como parte de esa aplicación.

Importante

La aplicación de este atributo no ofusca automáticamente la entidad de código a la que se aplica. Aplicar el atributo es una alternativa a la creación de un archivo de configuración para la herramienta de ofuscación. Es decir, simplemente proporciona instrucciones para una herramienta de ofuscación. Microsoft recomienda que los proveedores de herramientas de ofuscación sigan la semántica que se describe aquí. Sin embargo, no hay ninguna garantía de que una herramienta determinada siga las recomendaciones de Microsoft.

Se aplica a