System.Diagnostics.ConditionalAttribute

E697439

System.Diagnostics.ConditionalAttribute is a C# attribute that conditionally includes or omits method calls in compiled code based on the presence of a specified compilation symbol.

All labels observed (2)

How this entity was disambiguated

Statements (41)

Predicate Object
instanceOf .NET class
attribute class
appliesTo instance methods
static methods
attributeUsageAllowMultiple true
attributeUsageInherited false
attributeUsageTargets Class
attributeUsageTargets Delegate
Method
Struct
baseClass System.Attribute
callSiteRequirement attribute must be visible at call site to be effective
commonUsage conditionally compile debug or trace logging calls
compileTimeBehavior checked by C# compiler
definedInAssembly System.Runtime.dll
mscorlib.dll
documentationExample [Conditional("DEBUG")] void DebugMethod() { ... }
doesNotApplyTo events
fields
indexers
properties
effectOnCallSite omits calls to attributed methods when symbol is not defined
effectOnMethodBody doesNotRemoveMethodDefinitionFromAssembly
equivalentInVB System.Diagnostics.ConditionalAttribute used with <Conditional("DEBUG")>
hasConstructor ConditionalAttribute(string conditionString)
hasProperty string ConditionString
introducedInFramework .NET Framework 1.0
linked to: .NET Framework
isPublic true
isSealed true
isSerializable true
language C#
languageFeatureCategory conditional compilation
namespace System.Diagnostics
purpose control inclusion of method calls based on compilation symbols
requires method return type must be void in C#
runtimeBehavior no runtime check is performed
typicalSymbolExample DEBUG
TRACE
usedWith conditional compilation symbols
preprocessor symbol defined via #define directive
preprocessor symbol defined via /define compiler option

How these facts were elicited

Referenced by (2)

Full triples — surface form annotated when it differs from this entity's canonical label.

C# attributes exampleAttribute System.Diagnostics.ConditionalAttribute
System.Diagnostics.ConditionalAttribute equivalentInVB System.Diagnostics.ConditionalAttribute used with <Conditional("DEBUG")>
linked to: System.Diagnostics.ConditionalAttribute