0
我试图使用MSBuild.Community.Tasks.Unzip提取压缩文件(* .zip)。MSBuild.Community.Tasks.Unzip在0 KB大小的内容文件上失败
但是,因为我的压缩文件包含0 KB大小的某些文件,通过这个原因,它与下面的错误而失败:
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)
我没有在我的输出文件夹需要这些文件。所以如果可能的话,甚至可以从提取中排除它。
任何想法来解决这个问题是高度赞赏?
有没有什么办法可以在使用MSBuild.Community.Tasks.Unzip解压缩时排除这些文件?