ASP.NET web.config transformation related on publish profile name
I've created a new web config which I named "Web.development.config". That's my project file code for transformations:
<UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll" />
<Target Name="AfterCompile" Condition="exists('Web.$(Configuration).config')">
<!-- Generate transformed app config in the intermediate directory -->
<TransformXml Source="Web.config" Destination="$(IntermediateOutputPath)$(TargetFileName).config" Transform="Web.$(Configuration).config" />
<!-- Force build process to use the transformed configuration file from now on. -->
<ItemGroup>
<AppConfigWithTargetPath Remove="Web.config" />
<AppConfigWithTargetPath Include="$(IntermediateOutputPath)$(TargetFileName).config">
<TargetPath>$(TargetFileName).config</TargetPath>
</AppConfigWithTargetPath>
</ItemGroup>
</Target>
So with this solution you can use Web.<your publish profile name>.config
When you want to create a publish profile, you see a dropdown list where you specify what mode it will be. Try to create a new publish profile and you will see.