ObfuscateAssemblyAttribute.AssemblyIsPrivate Property

Definition

Gets a Boolean value indicating whether the assembly was marked private.

C#
public bool AssemblyIsPrivate { get; }

Property Value

true if the assembly was marked private; otherwise, false.

Examples

The following code example shows how the attribute constructor sets the AssemblyIsPrivate property to true, to specify that an assembly is private. The StripAfterObfuscation property is false, to prevent the obfuscation tool from stripping the attribute after processing.

C#
using System;
using System.Reflection;

[assembly: ObfuscateAssemblyAttribute(true,
    StripAfterObfuscation=false)]

Remarks

A private assembly is used only by the application of which it is a part, and not by other software.

Important

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 recommends that vendors of obfuscation tools follow the semantics described here. However, there is no guarantee that a particular tool follows Microsoft recommendations.

Applies to

Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1