Conditional Compilation
Now here's a trick that I didn't know - you can use the [Conditional] attribute to suppress a method unless a given symbol is defined at compile time.
From the MSDN documentation:
Applying ConditionalAttribute to a method indicates ... the method should not be compiled into Microsoft intermediate language (MSIL) unless the conditional compilation symbol that is associated with ConditionalAttribute is defined.
Mostly of use when you're writing logging and other diagnostic code - indeed, major use in the framework seems to be in the Debug and Trace classes.
See details on MSDN at http://msdn2.microsoft.com/en-us/library/system.diagnostics.conditionala...

Recent comments
6 days 7 hours ago
1 week 10 hours ago
1 week 1 day ago
1 week 2 days ago
2 weeks 3 days ago
10 weeks 5 days ago
18 weeks 3 days ago
18 weeks 3 days ago
18 weeks 3 days ago
18 weeks 3 days ago