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
Did you, by any chance, tick the "Define DEBUG constant" for the Release configuration, while you were in the Project Properties / Build?
Also make sure you are not building the project-level Debug configuration within the solution-level Release configuration (see the Configuration Manager).
If you are using ASP.NET make sure about this line in Web.Config file:
<compilation debug="false" targetFramework="4.5">
So if debug="true" your project runs in DEBUG mode.