Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create my own defined constants based on the "Configuration Manager"?

When I select the "Debug" configuration, the DEBUG constant is active. When I select the "Release" configuration, the DEBUG constant is inactive.

How can I create my own configurations so that they include my own defined constants. Basically, I want it so that if I select the configuration "FOOBAR" that there is a constant FOO and BAR in my project active.

I'm basically trying to avoid putting in a bunch of #define FOO in my projects, then commenting/uncommenting them out when I need/don't need them.

like image 974
myermian Avatar asked Oct 20 '10 18:10

myermian


People also ask

How do I create a new configuration in Visual Studio?

In the Configuration drop-down list for that project, choose New. The New Project Configuration dialog box opens. In the Name box, enter a name for the new configuration. To use the property settings from an existing project configuration, in the Copy settings from drop-down list, choose a configuration.

How do I access the Configuration Manager in Visual Studio?

The project configuration determines what build settings and compiler options are used when you build the project. To create, select, modify, or delete a configuration, you can use the Configuration Manager. To open it, on the menu bar, choose Build > Configuration Manager, or just type Configuration in the search box.

How do I add Release configuration in Visual Studio?

In Solution Explorer, right-click the project and choose Properties. In the side pane, choose Build (or Compile in Visual Basic). In the Configuration list at the top, choose Debug or Release. Select the Advanced button (or the Advanced Compile Options button in Visual Basic).

How do I change the build configuration platform in Visual Studio?

Click TOOLS > SETTINGS > check EXPERT SETTINGS to see the build configuration manager (This is only applicable to Visual Studio 2010 Express Edition and NOT for 2008 Express Edition) Click BUILD > CONFIGURATION MANAGER select the platform dropdown to X86 and click CLOSE.


1 Answers

According to this article you can define compilation constants in the build tab of your project properties.

enter image description here

EDITED: To define build configurations you can go to Build > Configuration manager and I think you can define compilation constants there too.

like image 114
GôTô Avatar answered Oct 01 '22 03:10

GôTô