Table of Contents

Class IsNotDeadCodeAttribute

Namespace
NDepend.Attributes
Assembly
NDepend.API.dll

This attribute can be used to signify that despite a member could be removed without provoking any syntax error (we also say it is dead code), your intention is to not remove this member.

[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Enum|AttributeTargets.Constructor|AttributeTargets.Method|AttributeTargets.Field|AttributeTargets.Interface|AttributeTargets.Delegate)]
public sealed class IsNotDeadCodeAttribute : Attribute
Inheritance
IsNotDeadCodeAttribute
Inherited Members
Extension Methods

Remarks

Some code rules are provided by default to match dead types, methods and fields, except those tagged with this attribute.
Typically, this attribute is useful when the code element :

  • is only used by tests
  • is only used for debugging purposes
  • is only used by reflection or remoting, like for some serialization methods
  • is a class that contains only constants, hence it is never used in IL code, and it is never seen as used by NDepend
  • is a field whose only need is for LayoutKind.Sequential reasons

Constructor (1)

IsNotDeadCodeAttribute()

Create a new instance of the IsNotDeadCodeAttribute class.

public IsNotDeadCodeAttribute()

See Also