Created
April 13, 2016 14:54
-
-
Save oscarandreu/5129ee2e5f13cb8e7fa7b08a75cc36e1 to your computer and use it in GitHub Desktop.
Visual Studio -- project file modifications to apply transformations in config file during compile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <PropertyGroup> | |
| <PostBuildEvent>$(MSBUILDBINPATH)\msbuild "$(ProjectPath)" /t:Transform /p:Configuration=$(ConfigurationName);Platform=AnyCPU | |
| xcopy "$(ProjectDir)obj\$(ConfigurationName)\Web.Config" $(ProjectDir)\. /F /R /Y | |
| </PostBuildEvent> | |
| </PropertyGroup> | |
| <Target Name="Transform"> | |
| <MakeDir Directories="obj\$(Configuration)" Condition="!Exists('obj\$(Configuration)')" /> | |
| <TransformXml Source="Web.Config" Transform="Web.$(Configuration).config" Destination="obj\$(Configuration)\Web.config" StackTrace="true" /> | |
| </Target> | |
| <Target Name="AfterBuild"> | |
| </Target> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment