ObfuscateAssemblyAttribute.StripAfterObfuscation 屬性


取得或設定 Boolean 值,指出模糊化工具是否應該在進行處理後移除屬性。Gets or sets a Boolean value indicating whether the obfuscation tool should remove the attribute after processing.

 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 the obfuscation tool should remove the attribute after processing; otherwise, false. 這個屬性的預設值為 trueThe default value for this property is true.


下列程式碼範例顯示ObfuscateAssemblyAttribute StripAfterObfuscation屬性設定為false的屬性, 以防止模糊化工具在處理之後去除屬性。The following code example shows the ObfuscateAssemblyAttribute attribute with the StripAfterObfuscation property set to false, to prevent the obfuscation tool from stripping the attribute after processing.

using System;
using System.Reflection;

[assembly: ObfuscateAssemblyAttribute(true, 
Imports System.Reflection

<Assembly: ObfuscateAssemblyAttribute(False, _


如果您的程式庫將會包含在另一個應用程式中, 則不應該移除屬性, 而是以該應用程式的一部分進行模糊處理。Attributes should not be stripped if your library will be included as part of another application, and obfuscated as part of that application.

指定混淆工具應該去除的ObfuscateAssemblyAttribute , 不會影響已套用至元件內之ObfuscationAttribute類型和成員的實例。Specifying that obfuscation tools should strip the ObfuscateAssemblyAttribute does not affect instances of ObfuscationAttribute that have been applied to types and members within the assembly.


套用這個屬性並不會自動模糊處理元件。Applying this attribute does not automatically obfuscate the assembly. 套用屬性是建立模糊化工具之設定檔的替代方法。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 建議混淆工具的廠商遵循這裡所述的語法。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.