Created
June 16, 2017 13:04
-
-
Save jmelosegui/8307e09eae9d96a894c65c823b41db88 to your computer and use it in GitHub Desktop.
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
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Web\Microsoft.Web.Publishing.Tasks.dll" /> | |
<!-- This will allow the config file to be copied to any project referencing the project that need the config transformation --> | |
<PropertyGroup> | |
<AllowedReferenceRelatedFileExtensions> | |
$(AllowedReferenceRelatedFileExtensions); | |
.dll.config | |
</AllowedReferenceRelatedFileExtensions> | |
</PropertyGroup> | |
<!-- This is needed to apply the transformation before the target that resolves project references --> | |
<PropertyGroup> | |
<ResolveReferencesDependsOn> | |
TransformConfig; | |
$(ResolveReferencesDependsOn) | |
</ResolveReferencesDependsOn> | |
</PropertyGroup> | |
<Target Name="TransformConfig" BeforeTargets="_CopyAppConfigFile" Condition="Exists('App.Publish.config') AND '$(BuildingInsideVisualStudio)' != 'true' "> | |
<!--Generate transformed app config in the intermediate directory--> | |
<TransformXml Source="App.config" Destination="$(IntermediateOutputPath)$(TargetFileName).config" Transform="App.Publish.config" /> | |
<!--Force build process to use the transformed configuration file from now on.--> | |
<ItemGroup> | |
<AppConfigWithTargetPath Remove="App.config" /> | |
<AppConfigWithTargetPath Include="$(IntermediateOutputPath)$(TargetFileName).config"> | |
<TargetPath>$(TargetFileName).config</TargetPath> | |
</AppConfigWithTargetPath> | |
</ItemGroup> | |
</Target> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment