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
If you are using ASP.NET make sure about this line in Web.Config file:
So if debug="true" your project runs in DEBUG mode.