Skip to content

Instantly share code, notes, and snippets.

@vcaraulean
Created March 5, 2015 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vcaraulean/114c365d422ae8a75e33 to your computer and use it in GitHub Desktop.
Save vcaraulean/114c365d422ae8a75e33 to your computer and use it in GitHub Desktop.
Confg transformations
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="TransformConfig" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="TransformXml"
AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll"/>
<Target Name="TransformConfig">
<TransformXml Source="$(SourcePath)\Web.config"
Transform="$(SourcePath)\Web.$(Configuration).config"
Destination="Web.config"/>
</Target>
</Project>
<PropertyGroup>
<PreBuildEvent>$(MSBuildToolsPath)\msbuild.exe $(ProjectDir)config_transform.msbuild /p:Configuration=$(ConfigurationName) /p:SourcePath="$(SolutionDir)ProjectBuilder.Config"</PreBuildEvent>
</PropertyGroup>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment