Define Symbols in Compiler Options - how to set a value

NealCulinerNealCuliner USBeta ✭✭✭


Probably stupid question but my upbringing is VB. I want to hide a feature until our external site that is referenced by this feature is complete. I know I can put in a symbol such as HIDEFOO and then just test in code using a #if HIDEFOO. But I seem to recall in VB days you could actually specify the value in the symbol so in the Compiler settings for Define Symbols I could use DEBUG;HIDEFOO=true and then later change HIDEFOO=false when our external site work is completed. I've tried this so far and it's not working in Xam Studio 4.0.13. Can I specify a value such as true/false in the symbol definition or is it word only?



  • mhutchmhutch USMember, Xamarin Team Xamurai
    edited October 2013

    C# does not support values for defines. They are either defined (true) or not defined (false). So

    #if FOO

    will be true if FOO is in your project's defines, and false if it's not.

  • NealCulinerNealCuliner USBeta ✭✭✭


Sign In or Register to comment.