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
source to share
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.
source to share
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.
source to share