views:

142

answers:

1

I am getting the transformed web.config in the deployment package incorrectly transformed.

The result is as follows (notice how the connection string gets generated):

<connectionStrings>
    <add name="xxxConnectionStringNamexxx"
         connectionString="$(ReplacableToken_xxxConnectionStringNamexxx-Web.config Connection String_0)" providerName="System.Data.SqlClient" />
</connectionStrings>

Web.Config:

<connectionStrings>
    <add name="xxxConnectionStringNamexxx" 
         connectionString="Data Source=.\sqlexpress2005;Initial Catalog=xxxx;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>

Web.Release.config:

<connectionStrings>
    <add name="xxxConnectionStringNamexxx" connectionString="Data Source=.\sqlexpress2005;Initial Catalog=xxxx;Integrated Security=True" providerName="System.Data.SqlClient" xdt:Transform="SetAttributes(connectionString)" xdt:Locator="Match(name)"/>
</connectionStrings>

Any ideas? Thanks

A: 

So benoit found an answer on the asp.net forums : http://stackoverflow.com/questions/3629850/replacabletoken-when-using-web-config-transform .

I deployed to a folder on my desktop and the web.config file was transformed correctly.

sirrocco
Thanks, you've pointed me out in the right direction. I was manually extracting the files from the zip file that was generated to be deployed using the command line tool, which will in turn replace that token with the correct connection string. Thanks again.
DanC