Visual C++: Creating a New Configuration

Creating a new configuration for compilation in Visual C++ is easy!

For example, say I want to create a new configuration that is same as Release mode, except I want assert() to be compiled. To do this:

  • Choose Project β†’ Properties and in the Properties dialog, choose Configuration Manager.
  • In the Active Solution Configuration dropdown, choose New.
  • In the New Solution Configuration dialog that pops up, give the new configuration a name (ReleaseWithAssert for example) and choose an existing configuration whose settings to copy from. For our example, I would choose to copy from Release. This creates a new configuration named ReleaseWithAssert with all the settings from the Release configuration.
  • Go into the new configuration settings and make the changes you want. For example, I typically enable assertions in Release mode by removing the definition of the NDEBUG preprocessor directive.