Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zip files after build completes in Visual Studio

Tags:

I have a requirement where I need to zip some files after I build a solution file.

Could this be achieved automatically once I build my project in Release/Debug mode?

like image 554
nishantcop Avatar asked Mar 28 '14 10:03

nishantcop


1 Answers

Using powershell, only when doing Release build:
if $(ConfigurationName) == Release (powershell Compress-Archive -Path '$(TargetDir)*.dll', '$(TargetDir)*.pdb', '$(TargetDir)*.config' -DestinationPath '$(SolutionDir)PublishOutput\YourNameHere.zip' -Force)

It only zips the dll, pdb and config files.
-Force is used to overwrite the zip file on each build.

like image 150
ArieKanarie Avatar answered Sep 20 '22 23:09

ArieKanarie