I am trying to apply config transformation in one of my C# projects. I can see the transformation applied when I do "Preview transform" on my QA config file but when I do publish with QA profile, I can still see the default config (not the transformed one) in deployment. I do not want the transformation on the build (I know slowcheetah helps in that), I would need that on publishing only. Is there any changes we need to do in the .csproj file to enable the transformations on publishing.
EDIT: Adding the sample config request by gkb. We have entry in web.config:
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\xxxx.mdf;Initial Catalog=xxxx;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>
AND I have below in my web.Debug-QA.config:
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
</system.web>
</configuration>