TransformXml Web.config when publishing

I am trying to use the TransformXml task to convert a configuration in a single shot regardless of the assembly configuration selected in visual studio. I can accomplish this by editing the .csproj file, and here it is.

    <UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll"/>
<Target Name="TransformWebConfig"  AfterTargets="AfterPublish">
    <TransformXml Source="$(SolutionDir)WCFServices\Web.config" 
              Transform="$(SolutionDir)WCFServices\Web.Release.config" 
              Destination="$(OutDir)WebRelease.config" 
              StackTrace="true" />
</Target>

The problem is that while I am publishing, the converted configuration files are placed in the output directory, but this happens before the delete operation. I need the configurations to be converted after the delete operation.

Please inform?

+3
source share
1 answer

Beware of MSBuild and VSBuild DO. Afterpublish is VERY limited

Try msbuild to save the emitted sln as well here .

, ? <message importance="high" text="Doing Custom Transform" /> transformxml, Finished Custom Transform . , .

msbuild:

, msbuild, VSBuild, . , , MSBuild msbuild:

msbuild, CSProj import target= . , .

VS- - http://blogs.msdn.com/b/visualstudio/archive/2010/07/06/debugging-msbuild-script-with-visual-studio.aspx + http://blogs.msdn.com/b/visualstudio/archive/2010/07/09/debugging-msbuild-script-with-visual-studio-2.aspx

http://blogs.msdn.com/b/msbuild/archive/2005/09/29/475157.aspx

0

All Articles