Skip to content

Instantly share code, notes, and snippets.

@jaltin
Forked from brianpursley/Example.pubxml
Created October 17, 2018 12:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaltin/4799eafcc7fa9d63facc78f30809e1b6 to your computer and use it in GitHub Desktop.
Save jaltin/4799eafcc7fa9d63facc78f30809e1b6 to your computer and use it in GitHub Desktop.
An example Visual Studio pubxml file to zip the output when publishing an ASP.NET web application to file system
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl>C:\Publish\SimpleExample</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
</PropertyGroup>
<Target Name="ZipPublishOutput" AfterTargets="GatherAllFilesToPublish">
<Exec Command='powershell -nologo -noprofile -command "compress-archive -force -path $(WPPAllFilesInSingleFolder)\* -destinationpath $(publishUrl).zip"' />
</Target>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment