3

I try to create msbuild that will zip the build package

i have those line in the msbuild file:

<UsingTask AssemblyFile="MSBuild.Community.Tasks.dll" TaskName="MSBuild.Community.Tasks.Zip" />
<Zip Files="$(OutputFiles)" ZipFileName="output\SomeService.v$(BuildNumber).zip" />

And when I run this msbuild I get exception:

error MSB4018:

The "Zip" task failed unexpectedly.\r C:\Projects\Services\SomeService\DeployClassificationService.build(92,5): error MSB4018: System.IO.FileNotFoundException: Could not load file or assembly 'ICSharpCode.SharpZipLib, Version=0.84.0.0, Culture=neutral, PublicKeyToken=1b03e6acf1164f73' or one of its dependencies. The system cannot find the file specified.\r

What is ICSharpCode? I tried to include it within the msbuild fir and it did not help.

Thanks, Alon

sll
  • 61,540
  • 22
  • 104
  • 156
Alon Ashkenazi
  • 1,223
  • 4
  • 21
  • 29
  • 1
    Download this file and put along with CommunityTasks DLL [ICSharpCode.SharpZipLib.dll](https://www.coderesort.com/p/epicode/export/797/EPiServer.Labs.ContentGenerator/5.x/MSBuild/MSBuildCommunityTasks/ICSharpCode.SharpZipLib.dll) – sll Mar 12 '12 at 20:45

5 Answers5

1

Looks like a dependency issue... i think the zip-task needs an assembly (namely ICSharpCode.SharpZipLib) to zip your files. Take a look here: http://www.icsharpcode.net/opensource/sharpziplib/Download.aspx or google for the assembly name by yourself and add that to your solution.. if you already did that try adding it via nuget to get the dependencies of that assembly resolved

Stephan
  • 1,639
  • 3
  • 15
  • 26
1

Got it, Just needed to include:

<Import Project="MSBuild.Community.Tasks.Targets" />
Christian.K
  • 47,778
  • 10
  • 99
  • 143
Alon Ashkenazi
  • 1,223
  • 4
  • 21
  • 29
1

When you install MSBuild Community Tasks, you should find ICSharpCode library in the installation folder %ProgramFiles%\MsBuild\MSBuildCommunityTasks.

You should use Community tasks like Anibas mentioned.
OR
Put ICSharpCode library into the same folder with with MSBuild.Community.Tasks.dll.

Ludwo
  • 6,043
  • 4
  • 32
  • 48
  • It's perhaps worth noting that for more recent readers MSBuild Community Tasks has since moved away from ICSharpCode and now embeds Ionic Zip inside its own dll; so this is not required for more recent versions (1.3+ I think; but cannot find exact changelog) – Chad Jan 22 '15 at 04:54
0

More recent version of Community Tasks requires Ionic.Zip.Reduced.dll now. Put that in my .build directory and all's well for me.

Erick Smith
  • 937
  • 7
  • 27
0

ICSharpCode here Did you have a look at this post, if it answers your question.

Community
  • 1
  • 1
CheGueVerra
  • 7,849
  • 4
  • 37
  • 49