Web.Debug.config does not handle replacement

I have a web application in VS2010 with web.config as follows:

...
<configuration>
  <connectionStrings>
    <add name="ApplicationServices"
         connectionString="data source=MyProdDb;Initial Catalog=MyCat;User Id=MyUser;Password=MyPass;"
         providerName="System.Data.SqlClient" /> 
  </connectionStrings>
...

and Web.Debug.config:

...
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
    <connectionStrings>
        <add name="ApplicationServices"
          connectionString="data source=MyDevDb;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
          xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
    </connectionStrings>
...

The project is set up to create a Debug assembly, and when I run it in the debugger, I get MyProdDb, notMyDevDb

What am I missing?

+5
source share
4 answers

According to People, the version of web.config apply only during the time of publication (MSDeploy). The usual way you will do this is to configure "Debug" in the actual web.config file and make changes to this for each of the deployment scripts that you have.

+2
source

?

, web.config . -, - . , F5, . , .

+3

Web.config . ( ) Web.config.

0

All Articles