127

I have a solution with 10+ projects (VS2010 SP1). I have the following configurations defined in the solution:

  • Debug
  • Debug-QA
  • Release-UAT
  • Release-Production

This allows me to easily setup specific settings for each deployment scenario. However, for some reason I can't get things setup as I'd like. Please see this screenshot:

Screenshot of Configuration Manager

Notice the highlighted projects/configurations. I am unable to create a "Debug-QA" configuration for these projects (by selecting <New> in the cell for that particular project). When I try to add a new "Debug-QA" configuration to the DataUtility project, for instance, Visual Studio yells at me:

This configuration could not be created because a solution configuration of the same name already exists.

I know it does! I'm trying to add the configuration to the project! What am I missing here? I want all projects to have all 5 configuration. I have the same problem when trying to match up (create) platforms (for instance, adding an "Any CPU" platform to the DataUtility project).

Ray
  • 187,153
  • 97
  • 222
  • 204
Josh M.
  • 26,437
  • 24
  • 119
  • 200
  • How are you trying to add the configuration to the project? Are you adding a new configuration from the drop down list in the grid, or from the drop down list up top (in your screenshot)? If you do it in the grid it should be ok. – Adam Plocher Oct 11 '12 at 18:51
  • @AdamPlocher: From the drop-down in the grid for the specific project. – Josh M. Oct 11 '12 at 19:02
  • 49
    Are you checking the "Create new solution configurations" checkbox? Leave it unchecked. – Adam Plocher Oct 11 '12 at 19:04
  • 2
    @AdamPlocher: What a moron I am. Man, I didn't even notice that - how obvious. Please submit that as your answer and I'll accept. Thanks! – Josh M. Oct 11 '12 at 19:07

3 Answers3

278

Make sure you're using the drop down list from the grid (not the one at the top of the dialog), and do not check the "Create new solution configurations" checkbox when adding your new project configuration.

Adam Plocher
  • 13,994
  • 6
  • 46
  • 79
  • 85
    Possibly the most overlooked checkbox in Visual Studio! – Rebecca Feb 25 '14 at 13:24
  • 4
    Years has this plagued me. It only rears it's ugly head every couple years or so but, alas, a solution!! lol – bbqchickenrobot Mar 19 '14 at 02:32
  • 5
    'Create new solution configurations' checkbox was causing the issue for me. Thanks for the solution!!! – Vikram Apr 24 '14 at 21:36
  • My issue was the "Create new solution configurations" checkbox. It seems unnecessary. – Declan Jan 09 '15 at 11:46
  • 4
    What the?! Somebody at microsoft must do a course in UI development. gah! – Kell Oct 26 '15 at 12:08
  • 1
    What a devilish checkbox! Thanks Adam! – JamesFaix Nov 15 '16 at 23:50
  • 2
    Vote for its removal on [VisualStudio Uservoice](https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/19029055-remove-the-create-new-solution-configurations-ch)! It's your future too! – m93a Apr 24 '17 at 13:44
  • Had this on VS2007 Community Edition. The "Create new solution configurations" checkbox was checked. I unchecked it as per Adam's suggestion and it worked just fine. – John Pittaway Jan 23 '18 at 22:31
  • On Visual Studio 2017 the problem remains, and it is called "Create new solution platforms". – Swiss Frank Feb 22 '21 at 04:36
  • I have attempted this without that checkbox clicked and it looks like it succeeds but I still don't have the new option in the drop down – WWZee Mar 04 '21 at 15:07
  • https://www.shirtpunch.com/products/hail-to-the-king-adam – Andreas Oct 11 '22 at 09:08
2

Here's a workaround if already checked the Create new solution configurations checkbox:

  1. Open Explorer and navigate to the location of the solution for the project that is missing platforms.
  2. Move the solution .sln file to a temorary location where Visual Studio won't locate it.
  3. Open the .csproj file for the project that is missing platforms.
  4. Click the Solutions Platform dropdown.
  5. Click Configuration Manager...
  6. In the table, Click the dropdown in the Platform column for the project and select , to add a new platform.
  7. Click OK.
  8. Repeat adding new platforms as needed.
  9. Save the project.
  10. Return the previously moved solution file back to where it was.
  11. Reopen the combined project solution.

source: https://developercommunity.visualstudio.com/content/problem/972/adding-a-platform-when-one-with-the-same-name-alre.html

Ray
  • 187,153
  • 97
  • 222
  • 204
1

The above solution didn't quite work, but I did find a solution on a forum that worked. Described below is to set the builds to x64 for each project that was set to "Any CPU", but the steps would also work for x86.

  1. Open the main solution. Unload each project with a conflict (not remove).

  2. Leave the solution open.

  3. In Explorer, navigate to the project folders and open the csproj file in Visual Studio.

  4. In this screwed up project, navigate to Build->Configuration Manager.

  5. If needed, "Add New" and set it to x64 and save.

  6. Right-click the project and set the build architecture to the new x64.

  7. Save this, but when you close the project in VS, do not save to the solution. That's unnecessary.

  8. Repeat for each project with a misaligned architecture.

  9. Finally, in the original solution with all the offending projects, reload each project.

  10. Open the Build->Configuration Manager for the solution. Then, one by one, reset "Any CPU" to the desired platform, in my case x64.

Save the changes for the solution and rebuild all. You should be OK, now.

enter image description here

Brian
  • 3,653
  • 1
  • 22
  • 33