Search code examples
c#visual-studiowindows-phone-8.1conditional-compilation

How to set Compilation directives for windows phone 8.1 project?


How to set Compilation directives for windows phone 8.1 project ? If i add new configuration in configuration manager how it use in code? Because its not work. Example:

string myStringItem="";
#if MyFirstConfig
myStringItem="FirstString";
#endif
#if MySecondConfig
myStringItem="SecondString";
#endif 

It does not work if I choose MyFirstConfig in the configuration manager, or if I choose MySecondConfig, does not work either. Why? How to do it correctly? Running last assignment, no matter what the chosen configuration. What to do?


Solution

  • You can edit them in your Build settings in each project.

    enter image description here