1

I modified the default Debug configuation, so that the output directories resemble $(SolutionDir)$(PlatformName)/$(ConfigurationName).

Next, I created debug variations, DebugStatic and DebugDll, to be more explicit about the target being created. I created them by copying the Debug configuration.

In similar fashion, I created ReleaseDLL and ReleaseStatic from the modified Release configuration.

Using Configuration Manager, I removed the Debug and Release configurations.

The Debug and Release configurations still show up in the Batch Build window and also in the Configuration drop down box in the Property Pages window (displayed from right clicking on the project name, then selecting Properties).

How do I cleanse, wipe-out, erase, obliterate, the Debug and Release configurations?

(The ambiguity of Debug has caused me many weeks of problem solving, especially when accidentally combining a Win32 debug DLL in an X64 project)
(I searched the web and StackOverflow, but didn't find anything about completely removing those configurations.)

Thomas Matthews
  • 56,849
  • 17
  • 98
  • 154
  • They are probably still in the .sln file. You can delete them with a text editor. They are bound to come back when you add a new project btw, you are fighting the system. – Hans Passant Apr 14 '13 at 20:37

3 Answers3

7

Solution and Project debug/release configurations are different.

Solution configurations may be controlled by configuration manager (Active Solution Configuration) and project configuration again can be controlled in the same manager for each project separately(project context)

enter image description here

In the image above, you can click on a project configuration, select edit and then you can remove the configuration.

fatihk
  • 7,789
  • 1
  • 26
  • 48
  • So how do I get the `Debug` and `Release` configurations out of the project configurations? – Thomas Matthews Apr 14 '13 at 20:21
  • 3
    I know this is an old answer, but I wanted to respond to @ThomasMatthews. When you click 'edit' on the project's configuration in the table shown above, you can remove the configuration from the -project-. To fully remove it from the solution you will need to drop down the box at the top left ('Active Solution Configuration') and choose 'edit'. This will allow you to remove the configurations from the -solution-. – Robert Petz May 09 '14 at 17:27
  • Is it possible to remove a certain configuration from 20-100 projects (at the same time / using a single step)? – cppBeginner Feb 17 '18 at 09:20
  • @cppBeginner, yes, it is possible, to fully remove a configuration for all projects from the solution you will need to select drop down at the top left ('Active Solution Configuration') and choose 'edit'. This will allow you to remove or rename any configuration you want – fatihk Feb 20 '18 at 12:53
  • The step you just mentioned can remove a configuration from solution, but not from any projects. If I do it, then click the project combo box (as in the image in your answer), the configuration will still exist in the pop-up list (similar as shown in the image) of every projects. – cppBeginner Feb 21 '18 at 03:01
  • 1
    @cppBeginner I agree it is ridiculous to delete a hundred project configurations one click at a time. fortunately there is a way: https://stackoverflow.com/a/48968790/7098259 – Patrick Parker Nov 01 '19 at 19:03
1

Note that to clear this from VS Batch build you must manually delete the property groups for DEBUG & RELEASE configurations from the project file XML.

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <OutputPath>bin\Debug\</OutputPath>
    <BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
Rohit
  • 51
  • 3
0

You should clear the configurations within the .SLN file

GlobalSection(SolutionConfigurationPlatforms) = preSolution
    **Undesired Debug**|Any CPU = Debug|Any CPU
    Debug|Any CPU = Debug|Any CPU
    Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
    {CE94D753-36C5-45FA-870A-4D61DAC98B71}.**Undesired Debug** .Net Native (Debug)|Any CPU.ActiveCfg = Debug|Any CPU
    {4EFA1043-8E1B-4950-8167-C77ABE626F1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    {4EFA1043-8E1B-4950-8167-C77ABE626F1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
    {4EFA1043-8E1B-4950-8167-C77ABE626F1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
    {4EFA1043-8E1B-4950-8167-C77ABE626F1E}.Release|Any CPU.Build.0 = Release|Any CPU
    {28D34A34-6E07-4FC3-A4B3-C704C1C5C7CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    {28D34A34-6E07-4FC3-A4B3-C704C1C5C7CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
    {28D34A34-6E07-4FC3-A4B3-C704C1C5C7CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
    {28D34A34-6E07-4FC3-A4B3-C704C1C5C7CE}.Release|Any CPU.Build.0 = Release|Any CPU
    {6B71D000-AC8D-49AF-ADA6-D96C7ECFF093}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    {6B71D000-AC8D-49AF-ADA6-D96C7ECFF093}.Debug|Any CPU.Build.0 = Debug|Any CPU
    {6B71D000-AC8D-49AF-ADA6-D96C7ECFF093}.Release|Any CPU.ActiveCfg = Release|Any CPU
    {6B71D000-AC8D-49AF-ADA6-D96C7ECFF093}.Release|Any CPU.Build.0 = Release|Any CPU
    {CE94D753-36C5-45FA-870A-4D61DAC98B71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    {CE94D753-36C5-45FA-870A-4D61DAC98B71}.Debug|Any CPU.Build.0 = Debug|Any CPU
    {CE94D753-36C5-45FA-870A-4D61DAC98B71}.Release|Any CPU.ActiveCfg = Release|Any CPU
    {CE94D753-36C5-45FA-870A-4D61DAC98B71}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
Luiz Lima
  • 101
  • 6