Created
March 9, 2017 15:08
-
-
Save brianpursley/671b1909e2359d2a0ab1ba004f7e5ea7 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
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"?> | |
<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
For anyone using VS 2019 or later, you can also leverage the
<ZipDirectory>
task: