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
Had a similar problem where "DEBUG" was never true. Tried by doing an uncheck and check of the "Define DEBUG constant" checkbox and rebuilding everytime but that did not work.
My solution was to define "DEBUG" manually in the "Conditional compilation symbols" textbox for the Debug configuration. When rebuilding, Visual Studio 2019 automatically removed the DEBUG symbol from the textbox (because this indeed should not be there) and from then on it worked again. When i switched from Debug to Release the correct lines got greyed out. This seems to be a possible bug in VS 2019 (16.4.5)?