The [Conditional] Attribute

By Roy Osherove In .Net Original

Markdown version

Historical article · Originally published September 1, 2003; technical details may be outdated.

If you want to write methods that are only available with conditional compiler arguments you can use an attribute just for that purpose:

<

Conditional("DEBUG")> _ Private Sub MyMethod() End Sub [Conditional("DEBUG")] Private void MyMethod()

{}

More in .Net Original

All posts in .Net Original