MSBuild - Zip a zip file

Oct 11, 2012 at 1:35 PM

I have tried to zip a zip file with msbuild zip but I cant get it to work. What am I doing wrong?


I have done this

<Target Name="BuildZip">
            <!-- All files from build -->
            <ZipFiles Include="..\..\Deploy\*.*"/>
        <MakeDir Directories="..\..\DeployTest" Condition="!Exists('$(..\..\DeployTest')" />
        <Zip Files="@(ZipFiles)"
             ZipLevel="9" />

and also tried this

   <Target Name="Zip">
        <CreateItem Include="..\..\Deploy\*.*" >
            <Output ItemName="ZipFiles" TaskParameter="Include"/>
        <Zip ZipFileName="" WorkingDirectory="..\..\Deploy\*.*" Files="@(ZipFiles)" />


It creates a empty zip file

Oct 11, 2012 at 2:17 PM


That's not the MSBuild Extension Pack zip task. The syntax for the MSBuild Extension Pack zip task can be found here



Oct 11, 2012 at 2:35 PM

oh. I have now change to what you say...but it says it cant find



Do you have any idea where that would be? The only thing I find is a msbuild folder with this

C:\Program Files\MSBuild\ExtensionPack\4.0

but there is no zip in it.

Oct 11, 2012 at 3:21 PM

do you have the import in your msbuild file?


<Import Project="$(MSBuildExtensionsPath)\ExtensionPack\4.0\MSBuild.ExtensionPack.tasks"/>

Marked as answer by mikeFourie on 5/26/2014 at 10:02 AM
Oct 12, 2012 at 6:26 AM

Yes. That was it. Thank.