Stef Heyenrath
Stef Heyenrath

Reputation: 9820

Is there a "ZIP project" in Visual Studio?

In Visual Studio there are several "Setup and Deployment" projects, one of these is "CAB Project".

http://i55.tinypic.com/21cxaoi.png

But I actually want a simple "ZIP Project" which enables me to add some folders + dll's from my solution and package this all in a zip file for easy distribution on the web.

Edit
@Cheeso
I created a dummy 'class library' project which has dependencies on all the sub projects. In this dummy project I used the post-build event to zip the dll's using 7-zip. But I was hoping that there was a better solution for this.

Upvotes: 5

Views: 7536

Answers (3)

Scott Weinstein
Scott Weinstein

Reputation: 19117

There's a (poorly marketed) feature of DPack, called Solution Backup that will create a zip file of your solution from within visual studio.

It's free and painless to install.

Upvotes: 0

Ergwun
Ergwun

Reputation: 12968

The MSBuild Extension Pack offers some compression tasks you could use.

For example, edit your project file, uncommenting the 'AfterBuild' target and including an appropriate compression task that packages up the content you want.

<Project>
  ...
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  -->
  <Target Name="AfterBuild">
    <ItemGroup>
      <!-- Set the collection of files to Zip-->
      <FilesToZip Include="C:\YourContent\*"/>
    </ItemGroup>

    <MSBuild.ExtensionPack.Compression.DNZip TaskAction="Create" CompressFiles="@(FilesToZip)" ZipFileName="C:\YourZipFile.zip"/>
  </Target>
</Project>

Upvotes: 4

Cheeso
Cheeso

Reputation: 192417

If I understand what you're after, a quick-and-easy solution might be to write a powershell or Javascript script, or a batch file, that runs as a post-build event.
You'll need a zip library, probably. DotNetZip works.

Upvotes: 1

Related Questions