Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zip using msbuild task

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

like image 627
Alon Ashkenazi Avatar asked May 31 '26 03:05

Alon Ashkenazi


2 Answers

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.

like image 179
Ludwo Avatar answered Jun 02 '26 14:06

Ludwo


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

like image 22
Stephan Avatar answered Jun 02 '26 13:06

Stephan