Search code examples
visual-studio-2013configurationmanager

Visual Studio 2013 Website Project - Change Configuration in Configuration Manager


I have Website Project in Visual Studio 2013. I have two Publishing Profiles, one for staging and the other for production. In Configuration Manager, I can create new Active Solution Configurations but cannot add new Configurations to my drop-down, Debug is the only option.

So now when I attempt to Publish using my production profile, the web.config is getting transformed by both the Web.Debug.Config and my web.Production.Config.

How do I add new Configurations to the dropdown?

enter image description here


Solution

  • To get my publish settings working the way I wanted I had to:

    • Return web.debug.config back to it's default contents (I had some transforms in here that I was using for my staging environment)
    • For every publish profile in /App_Data/PublishProfiles/, right click and select Add Config Transform to create a new config file at the root of the site (note that it will not be nested under the default web.config unless the profile is titled debug or release, kinda odd if you ask me)
    • Add any relevant transforms to each of these new configs

    Since all publish profiles in a website project seem to be stuck on a debug configuration, there was no way for me to avoid web.debug.config transforming my default web.config. With this solution, we simply don't use web.config for publish specific transforms.

    I'd like to credit Chris O'Neill for his helpful, if verbose, answer that clued me into this solution.