Skip to content

Instantly share code, notes, and snippets.

@CodeTroopers
Created November 13, 2019 16:57
Show Gist options
  • Save CodeTroopers/ff3b954fb106645df95830c17128079d to your computer and use it in GitHub Desktop.
Save CodeTroopers/ff3b954fb106645df95830c17128079d to your computer and use it in GitHub Desktop.
Publish several webapplications of a solution with MSBuild /p:DeployOnBuild=true /p:WebPublishMethod=FileSystem /p:PublishUrl="$(Build.ArtifactStagingDirectory)" /p:DeployDefaultTarget=WebPublish
<!-- Override target WebFileSystemPublish to include ProjectName in PublishUrl -->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebFileSystemPublishDependsOn>
SetPublishUrl;
$(WebFileSystemPublishDependsOn);
</WebFileSystemPublishDependsOn>
</PropertyGroup>
<Target Name="SetPublishUrl">
<PropertyGroup>
<PublishUrl Condition="'$(PublishUrl)'!=''">$(PublishUrl)\$(ProjectName)</PublishUrl>
</PropertyGroup>
</Target>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment