Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.