First you need to create a new configuration in VS. I've taken some pictures to help the Scott Hanselman page .
Go to Configuration Manager
:
CreateanewsettingintheselectorwhereyouprobablyalreadyhaveDebug
andRelease
.andchooseonewithcopysource.Youcancreateanewversionofandrelease:
Then you will go to the property page for your project. In the tab Build
you will create a conditional compilation symbol . It would be nice to use a name like the name you used in the newly created configuration, just to standardize. You will obviously create this symbol by choosing the new setting you created.
Then in your code you will use #if SIMBOLO_CRIADO
to choose whether that code snippet should be compiled in that version or not.
#if MENU1
ChamaMenu1();
#elif MENU2
ChamaMenu2();
#endif
Conditional Compilation Policy Documentation .
Watch out for this, if you abuse it you start to get lost.
Configuration Manager Documentation .