I wish to make an attribute conditional based on compilation mode.
For example this is MyFunction()
which is decorated with the attribute MyAttribute()
:
<MyAttribute()>
Private Function MyFunction() As Boolean
....
End Function
However I only want the attribute to be applied when DEBUG is true, which sounds like a great place to use compiler directives:
#If Debug Then
<MyAttribute()>
#End If
Private Function MyFunction() As Boolean
....
End Function
However this seems to require a continuation character ( _) which in turn affects the #End If
(unexpected token).
How would I achieve what I want?