ObfuscationAttribute.StripAfterObfuscation ObfuscationAttribute.StripAfterObfuscation ObfuscationAttribute.StripAfterObfuscation ObfuscationAttribute.StripAfterObfuscation Property

定義

隠ぺいツールが処理後に属性を削除する必要があるかどうかを示す Boolean 値を取得または設定します。Gets or sets a Boolean value indicating whether the obfuscation tool should remove this attribute after processing.

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。それ以外の場合は falsetrue if an obfuscation tool should remove the attribute after processing; otherwise, false. 既定値は、true です。The default is true.

難読化ツールが難読化ObfuscationAttributeStripAfterObfuscationに属性falseを削除しないように、プロパティがであるを次のコード例に示します。The following code example shows an ObfuscationAttribute whose StripAfterObfuscation property is false so that the obfuscation tool will not strip the attribute after obfuscation. プロパティの既定falseExcludeはであるExcludeため、難読化MethodAから除外さtrueれることを避けるために、プロパティにを指定する必要があります。It is necessary to specify false for the Exclude property to avoid excluding MethodA from obfuscation, because the default for the Exclude property is true.

このコードは、コンパイルして実行できる大きな例の一部です。This code is part of a larger example that can be compiled and executed. 詳細については、ObfuscationAttribute クラスのトピックを参照してください。See the ObfuscationAttribute class.

[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

注釈

ライブラリが別のアプリケーションの一部として含まれ、そのアプリケーションの一部として難読化されている場合は、属性を削除しないでください。Attributes should not be stripped if your library will be included as part of another application, and obfuscated as part of that application.

重要

この属性を適用しても、適用先のコードエンティティは自動的に難読化されません。Applying this attribute does not automatically obfuscate the code entity to which you apply it. 属性を適用することは、難読化ツールの構成ファイルを作成する方法の1つです。Applying the attribute is an alternative to creating a configuration file for the obfuscation tool. つまり、難読化ツールの手順を説明するだけです。That is, it merely provides instructions for an obfuscation tool. 難読化ツールのベンダーは、ここで説明するセマンティクスに従うことをお勧めします。Microsoft recommends that vendors of obfuscation tools follow the semantics described here. ただし、特定のツールが Microsoft の推奨事項に従うという保証はありません。However, there is no guarantee that a particular tool follows Microsoft recommendations.

適用対象