I’ve got my web.config. I have the box on the “Solution Configurations” set to Release, and what I’ve done is modify web.release.config to look like this (actual connection details redacted of course):
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<add name="ApplicationServices"
connectionString="data source=mysite.com;Database=mydb;uid=myuser;pwd=mypassword;"
providerName="MySql.Data.MySqlClient"/>
</connectionStrings>
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
</system.web>
</configuration>
The connectionString that I added, however, does not get included whenever I use the publish feature to put it up on my production server. Any suggestions on some critical step I’m missing?
You need to specify the transformation in your element. Add
xdt:Locator="Match(name)" xdt:Transform="SetAttributes(connectionString)"in theaddelement. Check the MSDN reference.