Search code examples
c#silverlightvisual-studio-2012windows-phone-8c-preprocessor

WP8 define multiple preprocessor values


I know that we can declare Preprocessor values in the properties settings of any app.

enter image description here

I can declare two or three macros in the Conditional compilation symbols, but what if I want to define 25 values here? Is there any other way, like a .cs file where I can link all my definitions here.


Solution

  • You can manually edit the .csproj file using Visual Studio's text editor.

    1. Right click on your project in Solution Explorer.
    2. Select Unload Project
    3. Right click on your (unloaded) project in Solution Explorer.
    4. Select Edit MyProject.csproj
    5. Find the DefineConstants elements and edit your defined symbols there directly. The settings for Debug and Release configurations are in separate PropertyGroup elements.
    6. Right click on your (unloaded) project in Solution Explorer.
    7. Select Reload Project