开发者

Is there a "ZIP project" in Visual Studio? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

In Visual Studio th开发者_Go百科ere are several "Setup and Deployment" projects, one of these is "CAB Project".

Is there a "ZIP project" in Visual Studio? [closed]

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.

  • Is there such a project type ?

  • When I want to create this by myself, what resources and references should I use to build this ?

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.


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>


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜