Created
January 23, 2017 22:59
-
-
Save BryanWilhite/2bdf1d95cb74f04c25729369ba2f0a56 to your computer and use it in GitHub Desktop.
sample *.pubxml with AddReplaceRuleForAppPath
This file contains 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"?> | |
<!-- | |
This file is used by the publish/package process of your Web project. You can customize the behavior of this process | |
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121. | |
--> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<PackageDependsOn> | |
$(PackageDependsOn); | |
AddReplaceRuleForAppPath; | |
</PackageDependsOn> | |
<WebPublishMethod>Package</WebPublishMethod> | |
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> | |
<LastUsedPlatform>Any CPU</LastUsedPlatform> | |
<SiteUrlToLaunchAfterPublish /> | |
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish> | |
<ExcludeApp_Data>False</ExcludeApp_Data> | |
<DesktopBuildPackageLocation>web-deploy-package\QA\my-web.zip</DesktopBuildPackageLocation> | |
<PackageAsSingleFile>true</PackageAsSingleFile> | |
<DeployIisAppPath>my-web</DeployIisAppPath> | |
<PackagePath Condition=" '$(PackagePath)'=='' ">website</PackagePath> | |
<EnableAddReplaceToUpdatePacakgePath Condition=" '$(EnableAddReplaceToUpdatePacakgePath)'=='' ">true</EnableAddReplaceToUpdatePacakgePath> | |
</PropertyGroup> | |
<Target Name="AddReplaceRuleForAppPath" Condition=" '$(EnableAddReplaceToUpdatePacakgePath)'=='true' "> | |
<PropertyGroup> | |
<_PkgPathFull>$([System.IO.Path]::GetFullPath($(WPPAllFilesInSingleFolder)))</_PkgPathFull> | |
</PropertyGroup> | |
<!-- escape the text into a regex --> | |
<EscapeTextForRegularExpressions Text="$(_PkgPathFull)"> | |
<Output TaskParameter="Result" PropertyName="_PkgPathRegex" /> | |
</EscapeTextForRegularExpressions> | |
<!-- add the replace rule to update the path --> | |
<ItemGroup> | |
<MsDeployReplaceRules Include="replaceFullPath"> | |
<Match>$(_PkgPathRegex)</Match> | |
<Replace>$(PackagePath)</Replace> | |
</MsDeployReplaceRules> | |
</ItemGroup> | |
</Target> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment