Posted on Wednesday, April 25, 2018 by nayana
Using GUI
- Open the project in Visual Studio
- Right-Click on the project file in the solution explorer go to properties
- Go to Build tab and Make sure you select the All Configurations in the configuration drop down
- Make sure selected the All Platforms in Platform drop-down
- Type the Preprocessor Definitions you want in the Conditional Compilation Symbols text box separated by semicolon
Directly in to Project file
- Open the project file in a Text Editor
- Copy and paste this code to end of existing PropertyGroup
<PropertyGroup Condition="'$(VariableName)'=='VarableValue'"> <DefineConstants>PDEF1;PDEF2;PDEF3</DefineConstants> </PropertyGroup>
- If you not required to add a condition, delete the Condition="'$(VariableName)'=='VarableValue'" part
- Save the project file and open from Visual Studio