Zip using msbuild task

I am trying to create a msbuild that will close the build package

I have this line in my 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 an exception:

error MSB4018:

The "Zip" task ended 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 in the msbuild writing file and it didn't help.

Thanks, Alon

+3


source to share


5 answers


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



You should be using community tasks like Anibas.
OR
Place the ICSharpCode library in the same folder using MSBuild.Community.Tasks.dll.

+1


source


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



+1


source


Got this, Just need to include:

<Import Project="MSBuild.Community.Tasks.Targets" />

      

+1


source


ICSharpCode here You saw this post if it answers your question.

0


source


A later version of Community Tasks requires Ionic.Zip.Reduced.dll now. Put this in my .build directory and it's good for me.

0


source







All Articles