First you need to create a new configuration in VS. I took some images to help in Scott Hanselman’s page.
Go to the Configuration Manager
:
![Configuration Manager](https://i.stack.imgur.com/BTqX0.png)
Create a new configuration on the selector you probably already have Debug
and Release
. and choose one of them with copy source. You can create a new version of yours for debug and another to release:
![Nova configuração](https://i.stack.imgur.com/o3tWp.png)
Then you will go to the properties page of your project. In tab Build
you will create a conditional compilation symbol. It would be good to use a name like the name you used in the new configuration created, just to standardize. You will obviously create this symbol by choosing the new configuration you created.
![Build tab](https://i.stack.imgur.com/h8PbP.jpg)
There in your code you will use #if SIMBOLO_CRIADO
to choose whether that chunk of code should be compiled in that version or not.
#if MENU1
ChamaMenu1();
#elif MENU2
ChamaMenu2();
#endif
Documentation of the conditional compilation directive.
Be careful with this, if you abuse you get lost.
Documentation of the settings manager.
Exactly that!
– Thiago Silva