ObfuscationAttribute.Exclude プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
隠ぺいツールが隠ぺいから型やメンバーを除外する必要があるのかどうかを示す Boolean 値を取得または設定します。
public:
property bool Exclude { bool get(); void set(bool value); };
public bool Exclude { get; set; }
member this.Exclude : bool with get, set
Public Property Exclude As Boolean
プロパティ値
この属性を適用する型やメンバーを隠ぺいから除外する必要がある場合は true
。それ以外の場合は false
。 既定値は、true
です。
例
次のコード例は、難読化から除外するようにマークされている型を示しています。 プロパティの既定値true
は であるため、 プロパティをExclude指定する必要はありませんが、明示的に指定すると意図が明確になります。 ApplyToMembersは にfalse
設定されているため、難読化からの除外は クラスのメンバーには適用されません。 つまり、クラス名は表示されますが、メンバーは難読化されます。
メソッドはMethodA
、 プロパティの値"default"
Featureでマークされます。 プロパティの既定値は であるため、難読化からの除外MethodA
を回避するには、 プロパティtrue
に を指定false
ExcludeするExclude必要があります。 プロパティは StripAfterObfuscation 、 false
難読化ツールが難読化後に属性を削除しないようにするためです。
このコードは、コンパイルおよび実行できる大きな例の一部です。 詳細については、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 の推奨事項に従っている保証はありません。
適用対象
.NET
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示