28

I added a solution configuration called 'Staging'. It does show up on the drop down in VS, but not in the Configuration Manager in 'Package/Publish Web' screen. On this screen, the ones I see in the dropdown are:

  • Active (Release)
  • Debug
  • Release
  • All Configurations

I don't see Staging in here for me to package in the Staging mode

Nick
  • 7,475
  • 18
  • 77
  • 128
  • Not sure about "solution configuration", configs only exist for projects, not solutions. Make sure to select the project first. – Hans Passant Jun 24 '10 at 16:58
  • My understanding is that you can add a solution configuration for the entire solution and a project configuration that can be assigned to individual projects. – Nick Jun 24 '10 at 19:38
  • Please refer to this link for an answer: [http://stackoverflow.com/a/16335748/674700](http://stackoverflow.com/a/16335748/674700). – Alex Filipovici May 02 '13 at 10:40
  • A solution from msdn blog http://blogs.msdn.com/b/nicgrave/archive/2010/06/19/platform-and-configuration-selection-in-visual-studio-2010-express-for-windows-phone.aspx – 131 Dec 24 '10 at 01:19
  • A similar question has been posted here: [When adding new C# projects in Visual Studio, additional configurations are not created automatically](http://stackoverflow.com/q/16335008/674700). Please refer to this link for a workaround: [http://stackoverflow.com/a/16335748/674700](http://stackoverflow.com/a/16335748/674700). – Alex Filipovici May 02 '13 at 10:41

4 Answers4

55

I found a solution to the issue of adding a new project AFTER creating a custom build config -

  1. Right click on the solution.
  2. Select "Properties" from the context menu.
  3. In the resulting dialog, click on "Configuration Properties" in the left hand pane.
  4. Click the "Configuration Manager..." button on top right.
  5. Scroll down to your new project.
  6. Under the "Configuration" column for your project, select <New...>.
  7. In the resulting dialog, enter the name of your existing project, and un-check the box that says "Create new solution configurations" (since it already exists on the solution level).
  8. Go into the properties of that project and you will now see this configuration. Apply necessary properties for that configuration in your project.
goodeye
  • 2,389
  • 6
  • 35
  • 68
shawn
  • 591
  • 4
  • 2
  • 2
    My experience is that this solution half-works. When the build configuration is changed projects that have been configured this way do not update. – Joel Skrepnek Aug 20 '12 at 13:49
  • ..due to using condition checking (configuration, platform) for almost each reference / source file on lots on projects, I must note the idea of replacing solution explorer and configuration manager straight to DIY msbuild script parser with read-evaluate-print-loop mode.. – kagali-san Sep 11 '13 at 20:47
  • 1
    This worked for me - works with VS 2012 and 2013 as well. Thanks for the solution! – Guy Starbuck Jan 07 '14 at 19:19
  • 4
    Thanks for that. I was going crazy. It's the little check box "Create new solution configurations" that was stopping me and I didn't ever bother to read it!! – NER1808 Dec 23 '15 at 16:59
  • 2
    We need this fixed, not another XAML/JS GUI framework. – Den Mar 18 '16 at 17:47
11

Workaround: open other project file, which already in configuration, found necessary node and copy them to target project file (with path/assembly file name fixes of course).

Pavel Martynov
  • 560
  • 4
  • 17
5

The cleanest way to do this that I have found is to modify the proect file (.csproj) directly in a text editor.

If you have a project that already has the desired configuration, open it up and find the appropriate PropertyGroup element (e.g. the one for the "Demo" configuration below).

Copy that PropertyGroup element and paste it after the equivalent element for the Debug configuaration.

If you do not already have one with the desired configuration for some reason, you should just be able to copy the Debug one (or Release if it is more appropriate) and change the name from "Debug" to whatever your configuration name is.

  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Demo|AnyCPU'">
    <OutputPath>bin\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <PlatformTarget>AnyCPU</PlatformTarget>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
    <Prefer32Bit>false</Prefer32Bit>
  </PropertyGroup>
kevinpo
  • 1,853
  • 19
  • 20
0

I am only using build configurations to transform my config files automatically. I fixed this by removing the build configuration from the solution, this did not remove my configuration transform file on VS2012, then i just added the configuration again. Now it appeared on all projects.

There could be issues with this approach that I simply don't know about, but for now its worked fine.

ruffen
  • 1,695
  • 2
  • 25
  • 51