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解壓縮時排除這些文件?