I have a C# web project. I opened the configuration manager, for "Active solution configuration" I chose
In the new window I typed the name (Dev), and didn't copy any settings. I checked off "Create new project configurations".
I right-clicked on my Web.config and chose "Add Config Transform". Web.Dev.config appeared indented under web.config as expected.
My web.config contains erroneous database values:
<connectionStrings>
<add name="PdxContext" connectionString="Data Source=badServer; Initial Catalog=badDB; Integrated Security=true; MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
</connectionStrings>
My Web.Dev.config, in part, contains valid DB values:
<connectionStrings>
<add name="PdxContext" connectionString="Data Source=.\sql2012; Initial Catalog=test; Integrated Security=True" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
...but when I select the Dev configuration and hit run, the site is run using the web.config file and not web.dev.config (it tries to connect to a non-existent database named "badDB" on host "badServer").
If I right-click on web.dev.config and choose "Preview Transform" the Transformed Web.config correctly shows that it will use the connectionStrings value from web.dev.config.
Oh, and in the Configuration Manager for Active Solution Configuration for "Dev" the configuration column has "Dev".
Any thoughts?