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.

Try in SPARQL Jump to: Statements Referenced by

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 NERFINISHED
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 NERFINISHED
mscorlib.dll NERFINISHED
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")> NERFINISHED
hasConstructor ConditionalAttribute(string conditionString)
hasProperty string ConditionString
introducedInFramework .NET Framework 1.0 NERFINISHED
isPublic true
isSealed true
isSerializable true
language C# NERFINISHED
languageFeatureCategory conditional compilation
namespace System.Diagnostics NERFINISHED
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

Referenced by (1)

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

C# attributes exampleAttribute System.Diagnostics.ConditionalAttribute