ObfuscateAssemblyAttribute.AssemblyIsPrivate 屬性

定義

取得 Boolean 值,指出組件是否標記為私用。Gets a Boolean value indicating whether the assembly was marked private.

public:
 property bool AssemblyIsPrivate { bool get(); };
public bool AssemblyIsPrivate { get; }
member this.AssemblyIsPrivate : bool
Public ReadOnly Property AssemblyIsPrivate As Boolean

屬性值

如果組件已標記為私用,則為 true,否則為 falsetrue if the assembly was marked private; otherwise, false.

範例

下列程式碼範例示範屬性的方法, 如何將AssemblyIsPrivate屬性設定true為, 以指定元件是私用的。The following code example shows how the attribute constructor sets the AssemblyIsPrivate property to true, to specify that an assembly is private. StripAfterObfuscation屬性為false, 以防止模糊化工具在處理後去除屬性。The StripAfterObfuscation property is false, to prevent the obfuscation tool from stripping the attribute after processing.

using System;
using System.Reflection;

[assembly: ObfuscateAssemblyAttribute(true, 
    StripAfterObfuscation=false)]
Imports System.Reflection

<Assembly: ObfuscateAssemblyAttribute(False, _
    StripAfterObfuscation:=False)>

備註

私用元件僅供其本身所屬的應用程式使用, 而不是由其他軟體使用。A private assembly is used only by the application of which it is a part, and not by other software.

重要

套用這個屬性並不會自動模糊處理元件。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.

適用於