I have several of these in my code which have been working fine so far:
#If DEBUG Then
... some code here
#End If
Now, i am
C# Project ( Visual Studio )
Uncheck "Define DEBUG constant"
Now select Configuration: Debug
Check "Define DEBUG constant"
In your code, you can now type the following ( DEBUG with uppercase )
#IF DEBUG // Debugging code goes here #ENDIF