How to delete folder using msbuild batch - asp.net

i have created on batch "del.bat".below is my batch script which is define in "del.bat"
I wanted to delete folder using batch after clicking "del.bat".when i am go to click "del.bat",nothing is happened.please let me know how to run it
<Project>
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="clean_folders">
<RemoveDir Directories="D:\projectdemo\crick\Cart"
ContinueOnError="true" />
</Target>
</Project>
c:
cd C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC
MSBuild.exe D:\projectdemo\demo.csproj /t:clean_folders>D:\projectdemo\output.txt

MSBuild is not located in the Visual Studio VC folder. This is the default folder where Command Prompt point to : the VS tools are located here.
MSBuild is not part of Visual Studio but of the .NET Framework.
MSBuild 4 (Visual Studio 2010) x86 is located in the Framework v4.0 folder :
"C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
D:\projectdemo\demo.csproj /t:clean_folders >
D:\projectdemo\output.txt

Related

Precompiling a site for deployment using .targets file for MSBuild

I have an ASP.NET web project (.Net 4.5, Visual Studio 2015).
The solution uses the XAML builds, not the newer web builds. Some of the builds deploy the application directly to the IIS server using a file copy.
We do not use the Publish action from Visual Studio to publish the project.
In the .csproj file of the ASP.NET project, the following import statement was added to add an additional .targets file:
<Import Project="CSADeploy.targets" Condition="Exists('CSADeploy.targets')" />
<Target Name="AdditionalTargets">
<!-- ... -->
</Target>
In this target file the files are copied.
Here is a short excerpt from the .targets file:
<?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
I would like the code that is deployed to the server to be precompiled for deployment either Deployment Only or Deployment with updateable UI is fine. I know there is a checkbox in the Publish action to precompile but I can't use that. I must use the existing XAML builds with the targets file and possibly instruction in the .csproj file.
I also know that I can use the Aspnet_compiler.exe tool on the server once the file are deployed. But I must do it before the file are copied because I do not have access to this server and I want to prevent adding a manual action to the build process.
How can I precompile the ASP.NET pages for deployment so that they are deployed correctly in my scenario?
You could create a .pubxml file for your project then check in to TFS, in the .pubxml file, set precompileBeforePublish to True.
<PropertyGroup>
......
<PrecompileBeforePublish>True</PrecompileBeforePublish>
</PropertyGroup>
In the xaml build definition, add these msbuild arguments:
/p:deployOnBuild=true /p:publishProfile=***.pubxml
Then in TFS xaml build, it will do precompile before deploy.

Visual Studio 2017 ASP.Net Publish Self-Contained Dot Net Core App

I have a .Net Core ASP.Net application in Visual Studio 2017. I am trying to do a self contained deployment of the application.
If I run the following command from the CLI it works exactly how I want and produces a .exe
dotnet publish -c release -r win7-x64
However if I publish from Visual Studio 2017 it does not produce a .exe and produces a .dll instead.
How can I replicate the -r win7-x64 of the dotnet publish command from within Visual Studio 2017?
Here is the contents of my .pubxml
<?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 https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<PublishProvider>FileSystem</PublishProvider>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<PublishFramework>netcoreapp1.1</PublishFramework>
<ProjectGuid>74bc47dd-6787-420d-804f-3f3d689d5ae5</ProjectGuid>
<publishUrl>C:\Deploy\JLM.MS.LeadGen.Dealer</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
<RuntimeIdentifiers>win7-x64</RuntimeIdentifiers>
</PropertyGroup>
</Project>
This experience has been added to the publish window for Visual Studio 2017 version 15.3 (which can be downloaded here)
If you right click on your project -> Publish -> click the "Settings..." link under "Summary" -> go to the Settings tab of the Publish window, you should see a Target Runtime dropdown where you can choose which platform you want your app to run on. Here's a screenshot of what I'm talking about.
Make sure in your project file to include the runtime you want to select in <RuntimeIdentifiers> or <RuntimeIdentifier>, as the dropdown looks for these properties in order to populate its values.
You need to add
<OutputType>Exe</OutputType>
to your .csproj

Copy Files after Publish events

I'm trying to copy reports with a "batch script" through MSBuild. I currently have a project that is targeting v3.5 in Visual Studio 2012.
I modified my website.publishproj and added:
<Target Name="MyTarget" AfterTargets="CopyAllFilesToSingleFolderForPackage" >
<Exec Command="echo ###################################### Copying Reports #################################" />
<Exec Command="xcopy.exe $(MSBuildProjectDirectory)\..\MoteurRapports $(PublishURL)\Rapports\ /S /E /H /EXCLUDE:$(MSBuildProjectDirectory)\CopyRapportExclude.txt" />
</Target>
But when I publish it:
254 files(s) copied
**Deleting existing files...**
Publishing folder /...
Publishing folder AideHTML...
It deletes the files I just copied. Is there a target after the deletion that I can use with the publish wizard?
I believe you may need to add this argument to your msbuild cmd. That will keep it from "cleaning" any files it believes are not part of the deployment.
/p:SkipExtraFilesOnServer=True

Why does this call to aspnet_compiler not produce new .NET assemblies?

I'm trying to make Visual Studio precompile my ASP.NET application that will be deployed on Azure. I've added the following to my .csproj file:
<Target Name="AfterBuild">
<Message Text="Starting AspNetCompiler for $(ProjectDir)" Importance="high" />
<AspNetCompiler
VirtualPath="/"
PhysicalPath="$(ProjectDir)"
/>
</Target>
Now when I ask Visual Studio to prepare a service package the following appears in the build output:
Starting AspNetCompiler for [PathToMyProject]
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v / -p [PathToMyProject]
If I plant an error in any of the view files that error is identified and breaks the build so clearly the precompilation is perfomed.
Yet I don't see any new .NET assemblies anywhere in the results.
How do I make ASP.NET compiler create the .NET assemblies for the views?
If you don't specify an output directory you should find the output in this folder:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\some-random-id (try sorting on the date modified to find the latest directory).
When calling the aspnet_compiler.exe you can also append an output folder to the command:
aspnet_compiler -v "/" -p "C:\Projects\WebApplication1\WebApplication1" C:\CompileOutput
Here you see the output in my C:\CompiledOutput folder

How to Publish Web with msbuild?

Visual Studio 2010 has a Publish command that allows you to publish your Web Application Project to a file system location. I'd like to do this on my TeamCity build server, so I need to do it with the solution runner or msbuild. I tried using the Publish target, but I think that might be for ClickOnce:
msbuild Project.csproj /t:Publish /p:Configuration=Deploy
I basically want to do exactly what a web deployment project does, but without the add-in. I need it to compile the WAP, remove any files unnecessary for execution, perform any web.config transformations, and copy the output to a specified location.
My Solution, based on Jeff Siver's answer
<Target Name="Deploy">
<MSBuild Projects="$(SolutionFile)"
Properties="Configuration=$(Configuration);DeployOnBuild=true;DeployTarget=Package"
ContinueOnError="false" />
<Exec Command=""$(ProjectPath)\obj\$(Configuration)\Package\$(ProjectName).deploy.cmd" /y /m:$(DeployServer) -enableRule:DoNotDeleteRule"
ContinueOnError="false" />
</Target>
I got it mostly working without a custom msbuild script. Here are the relevant TeamCity build configuration settings:
Artifact paths: %system.teamcity.build.workingDir%\MyProject\obj\Debug\Package\PackageTmp
Type of runner: MSBuild (Runner for MSBuild files)
Build file path: MyProject\MyProject.csproj
Working directory: same as checkout directory
MSBuild version: Microsoft .NET Framework 4.0
MSBuild ToolsVersion: 4.0
Run platform: x86
Targets: Package
Command line parameters to MSBuild.exe: /p:Configuration=Debug
This will compile, package (with web.config transformation), and save the output as artifacts. The only thing missing is copying the output to a specified location, but that could be done either in another TeamCity build configuration with an artifact dependency or with an msbuild script.
Update
Here is an msbuild script that will compile, package (with web.config transformation), and copy the output to my staging server
<?xml version="1.0" encoding="utf-8" ?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<SolutionName>MySolution</SolutionName>
<SolutionFile>$(SolutionName).sln</SolutionFile>
<ProjectName>MyProject</ProjectName>
<ProjectFile>$(ProjectName)\$(ProjectName).csproj</ProjectFile>
</PropertyGroup>
<Target Name="Build" DependsOnTargets="BuildPackage;CopyOutput" />
<Target Name="BuildPackage">
<MSBuild Projects="$(SolutionFile)" ContinueOnError="false" Targets="Rebuild" Properties="Configuration=$(Configuration)" />
<MSBuild Projects="$(ProjectFile)" ContinueOnError="false" Targets="Package" Properties="Configuration=$(Configuration)" />
</Target>
<Target Name="CopyOutput">
<ItemGroup>
<PackagedFiles Include="$(ProjectName)\obj\$(Configuration)\Package\PackageTmp\**\*.*"/>
</ItemGroup>
<Copy SourceFiles="#(PackagedFiles)" DestinationFiles="#(PackagedFiles->'\\build02\wwwroot\$(ProjectName)\$(Configuration)\%(RecursiveDir)%(Filename)%(Extension)')"/>
</Target>
</Project>
You can also remove the SolutionName and ProjectName properties from the PropertyGroup tag and pass them to msbuild.
msbuild build.xml /p:Configuration=Deploy;SolutionName=MySolution;ProjectName=MyProject
Update 2
Since this question still gets a good deal of traffic, I thought it was worth updating my answer with my current script that uses Web Deploy (also known as MSDeploy).
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<ProjectFile Condition=" '$(ProjectFile)' == '' ">$(ProjectName)\$(ProjectName).csproj</ProjectFile>
<DeployServiceUrl Condition=" '$(DeployServiceUrl)' == '' ">http://staging-server/MSDeployAgentService</DeployServiceUrl>
</PropertyGroup>
<Target Name="VerifyProperties">
<!-- Verify that we have values for all required properties -->
<Error Condition=" '$(ProjectName)' == '' " Text="ProjectName is required." />
</Target>
<Target Name="Build" DependsOnTargets="VerifyProperties">
<!-- Deploy using windows authentication -->
<MSBuild Projects="$(ProjectFile)"
Properties="Configuration=$(Configuration);
MvcBuildViews=False;
DeployOnBuild=true;
DeployTarget=MSDeployPublish;
CreatePackageOnPublish=True;
AllowUntrustedCertificate=True;
MSDeployPublishMethod=RemoteAgent;
MsDeployServiceUrl=$(DeployServiceUrl);
SkipExtraFilesOnServer=True;
UserName=;
Password=;"
ContinueOnError="false" />
</Target>
</Project>
In TeamCity, I have parameters named env.Configuration, env.ProjectName and env.DeployServiceUrl. The MSBuild runner has the build file path and the parameters are passed automagically (you don't have to specify them in Command line parameters).
You can also run it from the command line:
msbuild build.xml /p:Configuration=Staging;ProjectName=MyProject;DeployServiceUrl=http://staging-server/MSDeployAgentService
Using the deployment profiles introduced in VS 2012, you can publish with the following command line:
msbuild MyProject.csproj /p:DeployOnBuild=true /p:PublishProfile=<profile-name> /p:Password=<insert-password> /p:VisualStudioVersion=11.0
For more information on the parameters see this.
The values for the /p:VisualStudioVersion parameter depend on your version of Visual Studio. Wikipedia has a table of Visual Studio releases and their versions.
I came up with such solution, works great for me:
msbuild /t:ResolveReferences;_WPPCopyWebApplication /p:BuildingProject=true;OutDir=C:\Temp\build\ Test.csproj
The secret sauce is _WPPCopyWebApplication target.
I don't know TeamCity so I hope this can work for you.
The best way I've found to do this is with MSDeploy.exe. This is part of the WebDeploy project run by Microsoft. You can download the bits here.
With WebDeploy, you run the command line
msdeploy.exe -verb:sync -source:contentPath=c:\webApp -dest:contentPath=c:\DeployedWebApp
This does the same thing as the VS Publish command, copying only the necessary bits to the deployment folder.
With VisualStudio 2012 there is a way to handle subj without publish profiles. You can pass output folder using parameters. It works both with absolute and relative path in 'publishUrl' parameter. You can use VS100COMNTOOLS, however you need to override VisualStudioVersion to use target 'WebPublish' from %ProgramFiles%\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets. With VisualStudioVersion 10.0 this script will succeed with no outputs :)
Update: I've managed to use this method on a build server with just Windows SDK 7.1 installed (no Visual Studio 2010 and 2012 on a machine). But I had to follow these steps to make it work:
Make Windows SDK 7.1 current on a machine using Simmo answer (https://stackoverflow.com/a/2907056/2164198)
Setting Registry Key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VS7\10.0 to "C:\Program Files\Microsoft Visual Studio 10.0\" (use your path as appropriate)
Copying folder %ProgramFiles%\MSBuild\Microsoft\VisualStudio\v11.0 from my developer machine to build server
Script:
set WORK_DIR=%~dp0
pushd %WORK_DIR%
set OUTPUTS=%WORK_DIR%..\Outputs
set CONFIG=%~1
if "%CONFIG%"=="" set CONFIG=Release
set VSTOOLS="%VS100COMNTOOLS%"
if %VSTOOLS%=="" set "PATH=%PATH%;%WINDIR%\Microsoft.NET\Framework\v4.0.30319" && goto skipvsinit
call "%VSTOOLS:~1,-1%vsvars32.bat"
if errorlevel 1 goto end
:skipvsinit
msbuild.exe Project.csproj /t:WebPublish /p:Configuration=%CONFIG% /p:VisualStudioVersion=11.0 /p:WebPublishMethod=FileSystem /p:publishUrl=%OUTPUTS%\Project
if errorlevel 1 goto end
:end
popd
exit /b %ERRORLEVEL%
found two different solutions which worked in slightly different way:
1. This solution is inspired by the answer from alexanderb [link]. Unfortunately it did not work for us - some dll's were not copied to the OutDir. We found out that replacing ResolveReferences with Build target solves the problem - now all necessary files are copied into the OutDir location.
msbuild /target:Build;_WPPCopyWebApplication /p:Configuration=Release;OutDir=C:\Tmp\myApp\ MyApp.csproj
Disadvantage of this solution was the fact that OutDir contained not only files for publish.
2. The first solution works well but not as we expected. We wanted to have the publish functionality as it is in Visual Studio IDE - i.e. only the files which should be published will be copied into the Output directory. As it has been already mentioned first solution copies much more files into the OutDir - the website for publish is then stored in _PublishedWebsites/{ProjectName} subfolder. The following command solves this - only the files for publish will be copied to desired folder. So now you have directory which can be directly published - in comparison with the first solution you will save some space on hard drive.
msbuild /target:Build;PipelinePreDeployCopyAllFilesToOneFolder /p:Configuration=Release;_PackageTempDir=C:\Tmp\myApp\;AutoParameterizationWebConfigConnectionStrings=false MyApp.csproj
AutoParameterizationWebConfigConnectionStrings=false parameter will guarantee that connection strings will not be handled as special artifacts and will be correctly generated - for more information see link.
this is my working batch
publish-my-website.bat
SET MSBUILD_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin"
SET PUBLISH_DIRECTORY="C:\MyWebsitePublished"
SET PROJECT="D:\Github\MyWebSite.csproj"
cd /d %MSBUILD_PATH%
MSBuild %PROJECT% /p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:DeleteExistingFiles=True /p:publishUrl=%PUBLISH_DIRECTORY%
Note that I installed Visual Studio on server to be able to run MsBuild.exe because the MsBuild.exe in .Net Framework folders don't work.
You must set your environments
< WebSite name>
< domain>
and reference my blog.(sorry post was Korean)
http://xyz37.blog.me/50124665657
http://blog.naver.com/PostSearchList.nhn?SearchText=webdeploy&blogId=xyz37&x=25&y=7
#ECHO OFF
:: http://stackoverflow.com/questions/5598668/valid-parameters-for-msdeploy-via-msbuild
::-DeployOnBuild -True
:: -False
::
::-DeployTarget -MsDeployPublish
:: -Package
::
::-Configuration -Name of a valid solution configuration
::
::-CreatePackageOnPublish -True
:: -False
::
::-DeployIisAppPath -<Web Site Name>/<Folder>
::
::-MsDeployServiceUrl -Location of MSDeploy installation you want to use
::
::-MsDeployPublishMethod -WMSVC (Web Management Service)
:: -RemoteAgent
::
::-AllowUntrustedCertificate (used with self-signed SSL certificates) -True
:: -False
::
::-UserName
::-Password
SETLOCAL
IF EXIST "%SystemRoot%\Microsoft.NET\Framework\v2.0.50727" SET FXPath="%SystemRoot%\Microsoft.NET\Framework\v2.0.50727"
IF EXIST "%SystemRoot%\Microsoft.NET\Framework\v3.5" SET FXPath="%SystemRoot%\Microsoft.NET\Framework\v3.5"
IF EXIST "%SystemRoot%\Microsoft.NET\Framework\v4.0.30319" SET FXPath="%SystemRoot%\Microsoft.NET\Framework\v4.0.30319"
SET targetFile=<web site fullPath ie. .\trunk\WebServer\WebServer.csproj
SET configuration=Release
SET msDeployServiceUrl=https://<domain>:8172/MsDeploy.axd
SET msDeploySite="<WebSite name>"
SET userName="WebDeploy"
SET password=%USERNAME%
SET platform=AnyCPU
SET msbuild=%FXPath%\MSBuild.exe /MaxCpuCount:%NUMBER_OF_PROCESSORS% /clp:ShowCommandLine
%MSBuild% %targetFile% /p:configuration=%configuration%;Platform=%platform% /p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=False /p:DeployIISAppPath=%msDeploySite% /p:MSDeployPublishMethod=WMSVC /p:MsDeployServiceUrl=%msDeployServiceUrl% /p:AllowUntrustedCertificate=True /p:UserName=%USERNAME% /p:Password=%password% /p:SkipExtraFilesOnServer=True /p:VisualStudioVersion=12.0
IF NOT "%ERRORLEVEL%"=="0" PAUSE
ENDLOCAL
You can Publish the Solution with desired path by below code, Here PublishInDFolder is the name that has the path where we need to publish(we need to create this in below pic)
You can create publish file like this
Add below 2 lines of code in batch file(.bat)
#echo OFF
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsMSBuildCmd.bat"
MSBuild.exe D:\\Solution\\DataLink.sln /p:DeployOnBuild=true /p:PublishProfile=PublishInDFolder
pause
This my batch file
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe C:\Projects\testPublish\testPublish.csproj /p:DeployOnBuild=true /property:Configuration=Release
if exist "C:\PublishDirectory" rd /q /s "C:\PublishDirectory"
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v / -p C:\Projects\testPublish\obj\Release\Package\PackageTmp -c C:\PublishDirectory
cd C:\PublishDirectory\bin
del *.xml
del *.pdb
For generating the publish output provide one more parameter.
msbuild example.sln /p:publishprofile=profilename /p:deployonbuild=true /p:configuration=debug/or any
you can use this command to publish web applications with Publish Profiles.
msbuild SolutionName.sln /p:DeployOnBuild=true /p:PublishProfile=PublishProfileName
This sample Publish Profile can create a release zip file with a version number that's in AssemblyInfo.cs File in the network path (create zip file and remove other published files with PowerShell command is optional).
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<Major>0</Major>
<Minor>1</Minor>
<Build>2</Build>
<Publish>C:\</Publish>
<publishUrl>$(Publish)</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
</PropertyGroup>
<Target Name="GetBuildUrl">
<PropertyGroup> <In>$([System.IO.File]::ReadAllText('$(MSBuildProjectDirectory)\Properties\AssemblyInfo.cs'))</In>
<TargetPath>\\NetworkPath\ProjectName</TargetPath>
<Pattern>^\s*\[assembly: AssemblyVersion\(\D*(\d+)\.(\d+)\.(\d+)\.(\d+)</Pattern>
<Major>$([System.Text.RegularExpressions.Regex]::Match($(In), $(Pattern), System.Text.RegularExpressions.RegexOptions.Multiline).Groups[1].Value)</Major>
<Minor>$([System.Text.RegularExpressions.Regex]::Match($(In), $(Pattern), System.Text.RegularExpressions.RegexOptions.Multiline).Groups[2].Value)</Minor>
<Build>$([System.Text.RegularExpressions.Regex]::Match($(In), $(Pattern), System.Text.RegularExpressions.RegexOptions.Multiline).Groups[3].Value)</Build>
<Sub>$([System.Text.RegularExpressions.Regex]::Match($(In), $(Pattern), System.Text.RegularExpressions.RegexOptions.Multiline).Groups[4].Value)</Sub>
<Publish>$(TargetPath)\$(Major).$(Minor).$(Build).$(Sub)\</Publish>
<publishUrl Condition=" '$(Publish)' != '' ">$(Publish)</publishUrl>
<publishUrl Condition=" '$(Publish)' == '' and '$(LastUsedBuildConfiguration)'!='' ">$(LastUsedBuildConfiguration)</publishUrl>
</PropertyGroup>
</Target>
<Target Name="BeforeBuild" DependsOnTargets="GetBuildUrl">
<Message Importance="High" Text="|" />
<Message Importance="High" Text=" ================================================================================================" />
<Message Importance="High" Text=" BUILD INFO " />
<Message Importance="High" Text=" Version [$(Major).$(Minor).$(Build)] found in [$(MSBuildProjectDirectory)\Properties\AssemblyInfo.cs] " />
<Message Importance="High" Text=" Build will be saved to [$(publishUrl)] " />
<Message Importance="High" Text=" =================================================================================================" />
<Message Importance="High" Text="|" />
</Target>
<Target Name="Zip" BeforeTargets="AfterBuild">
<Exec Command="PowerShell -command Compress-Archive -Path $(Publish) -DestinationPath $(Publish)Release.zip" />
<Exec Command="PowerShell -command Remove-Item -Recurse -Force $(Publish) -Exclude Release.zip" />
</Target>
</Project>

Resources