ObfuscationAttribute.StripAfterObfuscation プロパティ

定義

隠ぺいツールが処理後に属性を削除する必要があるかどうかを示す Boolean 値を取得または設定します。

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

プロパティ値

隠ぺいツールが処理後に属性を削除する必要がある場合は true。それ以外の場合は false。 既定値は、true です。

次のコード例は、ObfuscationAttributeStripAfterObfuscation難読化ツールがfalse難読化後に属性を取り除かないように、 プロパティが である を示しています。 プロパティの既定値は であるため、難読化から除外MethodAしないようにプロパティtrueに を指定ExcludefalseするExclude必要があります。

このコードは、コンパイルおよび実行できるより大きな例の一部です。 詳細については、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

注釈

ライブラリが別のアプリケーションの一部として含まれ、そのアプリケーションの一部として難読化される場合は、属性を削除しないでください。

重要

この属性を適用しても、適用先のコード エンティティが自動的に難読化されることはありません。 属性の適用は、難読化ツールの構成ファイルを作成する代わりに使用します。 つまり、難読化ツールの指示を提供するだけです。 Microsoftでは、難読化ツールのベンダーは、ここで説明するセマンティクスに従うことをお勧めします。 ただし、特定のツールがMicrosoft推奨事項に従う保証はありません。

適用対象