For this reason, Configuration Manager exists.
- Go to Configuration Manager and create a new copy configuration from the predefined DEBUG configuration.
- Name the configuration DEVELOPMENT and apply to all projects
- Select the DEVELOPMENT configuration as the active configuration (it should already be active)
- Go to the properties page of each project that requires
#if DEVELOPMENT
conditionally compile and insert the DEVELOPMENT symbol in the first text field of the BUILD tab.
Now each of your projects can use the #if DEVELOPMENT preprocessor directive
If you also need this for RELEASE, repeat the above steps, but copy RELEASE from the predefined configuration and specify a different name NAME
Now, switching from a configuration with or without a specific DEVELOPMENT symbol can be performed directly from the combined Solution Configuration tool presented on the standard Visual Studio toolbar without editing each project.
You can also view the MSDN article How to Create and Modify Configurations
Steve source share