Zip Class

MSBuild

Create a zip file with the files specified.


Namespace: MSBuild.Community.Tasks
Assembly: MSBuild.Community.Tasks (in MSBuild.Community.Tasks.dll)

Syntax

Visual Basic (Declaration)
Public Class Zip
    Inherits Task
C#
public class Zip : Task
C++
ref class Zip : Task
J#
public class Zip extends Task
JScript
public class Zip extends Task

Example

Create a zip file

 Copy Code
            <ItemGroup>
                <ZipFiles Include="**\*.*" Exclude="*.zip" />
            </ItemGroup>
            <Target Name="Zip">
                <Zip Files="@(ZipFiles)" 
                    ZipFileName="MSBuild.Community.Tasks.zip" />
            </Target>
            
Create a zip file using a working directory.
 Copy Code
            <ItemGroup>
                <RepoFiles Include="D:\svn\repo\**\*.*" />
            </ItemGroup>
            <Target Name="Zip">
                <Zip Files="@(RepoFiles)" 
                    WorkingDirectory="D:\svn\repo" 
                    ZipFileName="D:\svn\repo.zip" />
            </Target>
            

Inheritance Hierarchy

System.Object
   Microsoft.Build.Utilities.Task
      MSBuild.Community.Tasks.Zip

Thread Safety

Public static (Shared in Visual Basic)staticShared members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

See Also

Syntax based on .NET Framework version 2.0.
Documentation version 1.0.0.0.