I was trying to extract a compressed file (*.zip) using MSBuild.Community.Tasks.Unzip.
But, since my compressed file contains some files with 0 KB size, by that reason it is failing with the following error:
error MSB4018: The "Unzip" task failed unexpectedly.
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: length
at ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.ReadClearTextBuffer(Byte[] outBuffer, Int32 offset, Int32 length)
at ICSharpCode.SharpZipLib.Zip.ZipInputStream.BodyRead(Byte[] b, Int32 off, Int32 len)
at ICSharpCode.SharpZipLib.Zip.ZipInputStream.InitialRead(Byte[] destination, Int32 offset, Int32 count)
at ICSharpCode.SharpZipLib.Zip.FastZip.ExtractFileEntry(ZipEntry entry, String targetName)
at ICSharpCode.SharpZipLib.Zip.FastZip.ExtractZip(String zipFileName, String targetDirectory, Overwrite overwrite, ConfirmOverwriteDelegate confirmDelegate, String fileFilter, String directoryFilter)
at MSBuild.Community.Tasks.Unzip.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)
I don't need these files in my output folder. So it can be even excluded from extraction if possible like that.
Any idea to tackle this issue is highly appreciated?
Is there any way to exclude these files during extraction using MSBuild.Community.Tasks.Unzip?