Closed
Description
Since version 1.2.0 an issue occurs when using System.IO.Compression.ZipArchive (an possibly other native implementations).
After uninstalling version 1.2.0 and installing 1.1.0, the issue was resolved.
This is the piece of code, that throws an exception
using(var zipFile = new System.IO.Compression.ZipArchive(zipStream, System.IO.Compression.ZipArchiveMode.Create)){
// Get artifacts from project
var artifactDirectory = Path.Combine(project.FullName, "bin", configuration);
if (Directory.GetDirectories(artifactDirectory).Any(e => e.EndsWith("net5.0"))){
artifactDirectory = Path.Combine(artifactDirectory, "net5.0");
}
// Copy all artifacts to the bin/ directory
foreach(var artifactFile in Directory.GetFiles(artifactDirectory, "*.*", SearchOption.AllDirectories)){
var entrySubstring = Path.Combine("bin", artifactFile.Substring(artifactDirectory.Length + 1));
// Following line (41) throws Exception -------------------------------------------------------------------------------
using(var writeStream = zipFile.CreateEntry(entrySubstring).Open()){
using (var readStream = File.OpenRead(artifactFile)){
readStream.CopyTo(writeStream);
Console.WriteLine("Creating '" + entrySubstring + "' from '" + artifactFile);
}
}
}
// ...
}
System.AggregateException: One or more errors occurred. (The underlying compression routine could not be loaded correctly.) (The underlying compression routine could not be loaded correctly.) (The underlying compression routine could not be loaded correctly.) (The underlying compression routine could not be loaded correctly.)
---> System.IO.Compression.ZLibException: The underlying compression routine could not be loaded correctly.
---> System.EntryPointNotFoundException: Unable to find an entry point named 'CompressionNative_DeflateInit2_' in DLL 'clrcompression.dll'.
at Interop.zlib.DeflateInit2_(ZStream& stream, CompressionLevel level, CompressionMethod method, Int32 windowBits, Int32 memLevel, CompressionStrategy strategy)
at System.IO.Compression.ZLibNative.ZLibStreamHandle.DeflateInit2_(CompressionLevel level, Int32 windowBits, Int32 memLevel, CompressionStrategy strategy)
at System.IO.Compression.ZLibNative.CreateZLibStreamForDeflate(ZLibStreamHandle& zLibStreamHandle, CompressionLevel level, Int32 windowBits, Int32 memLevel, CompressionStrategy strategy)
at System.IO.Compression.Deflater..ctor(CompressionLevel compressionLevel, Int32 windowBits)
--- End of inner exception stack trace ---
at System.IO.Compression.Deflater..ctor(CompressionLevel compressionLevel, Int32 windowBits)
at System.IO.Compression.DeflateStream.InitializeDeflater(Stream stream, Boolean leaveOpen, Int32 windowBits, CompressionLevel compressionLevel)
at System.IO.Compression.DeflateStream..ctor(Stream stream, CompressionLevel compressionLevel, Boolean leaveOpen, Int32 windowBits)
at System.IO.Compression.DeflateStream..ctor(Stream stream, CompressionLevel compressionLevel, Boolean leaveOpen)
at System.IO.Compression.ZipArchiveEntry.GetDataCompressor(Stream backingStream, Boolean leaveBackingStreamOpen, EventHandler onClose)
at System.IO.Compression.ZipArchiveEntry.OpenInWriteMode()
at System.IO.Compression.ZipArchiveEntry.Open()
at Submission#0.<<Initialize>>b__0_1(DirectoryInfo project) in C:\projects\export\build_scripts\bundle.csx:line 41
at System.Threading.Tasks.Parallel.<>c__DisplayClass33_0`2.<ForEachWorker>b__0(Int32 i)
at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
at System.Threading.Tasks.TaskReplicator.Replica`1.ExecuteAction(Boolean& yieldedBeforeCompletion)
at System.Threading.Tasks.TaskReplicator.Replica.Execute()
--- End of inner exception stack trace ---
at System.Threading.Tasks.TaskReplicator.Run[TState](ReplicatableUserAction`1 action, ParallelOptions options, Boolean stopOnFirstFailure)
at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
--- End of stack trace from previous location ---
at System.Threading.Tasks.Parallel.ThrowSingleCancellationExceptionOrOtherException(ICollection exceptions, CancellationToken cancelToken, Exception otherException)
at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IList`1 list, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, Action`1 body)
at Submission#0.<<Initialize>>d__0.MoveNext() in C:\projects\export\build_scripts\bundle.csx:line 18
--- End of stack trace from previous location ---
at Dotnet.Script.Core.ScriptRunner.Execute[TReturn](String dllPath, IEnumerable`1 commandLineArgs) in C:\Users\VssAdministrator\AppData\Local\Temp\tmp5CA8\Dotnet.Script.Core\ScriptRunner.cs:line 112
---> (Inner Exception #1) System.IO.Compression.ZLibException: The underlying compression routine could not be loaded correctly.
---> System.EntryPointNotFoundException: Unable to find an entry point named 'CompressionNative_DeflateInit2_' in DLL 'clrcompression.dll'.
at Interop.zlib.DeflateInit2_(ZStream& stream, CompressionLevel level, CompressionMethod method, Int32 windowBits, Int32 memLevel, CompressionStrategy strategy)
at System.IO.Compression.ZLibNative.ZLibStreamHandle.DeflateInit2_(CompressionLevel level, Int32 windowBits, Int32 memLevel, CompressionStrategy strategy)
at System.IO.Compression.ZLibNative.CreateZLibStreamForDeflate(ZLibStreamHandle& zLibStreamHandle, CompressionLevel level, Int32 windowBits, Int32 memLevel, CompressionStrategy strategy)
at System.IO.Compression.Deflater..ctor(CompressionLevel compressionLevel, Int32 windowBits)
--- End of inner exception stack trace ---
at System.IO.Compression.Deflater..ctor(CompressionLevel compressionLevel, Int32 windowBits)
at System.IO.Compression.DeflateStream.InitializeDeflater(Stream stream, Boolean leaveOpen, Int32 windowBits, CompressionLevel compressionLevel)
at System.IO.Compression.DeflateStream..ctor(Stream stream, CompressionLevel compressionLevel, Boolean leaveOpen, Int32 windowBits)
at System.IO.Compression.DeflateStream..ctor(Stream stream, CompressionLevel compressionLevel, Boolean leaveOpen)
at System.IO.Compression.ZipArchiveEntry.GetDataCompressor(Stream backingStream, Boolean leaveBackingStreamOpen, EventHandler onClose)
at System.IO.Compression.ZipArchiveEntry.OpenInWriteMode()
at System.IO.Compression.ZipArchiveEntry.Open()
at Submission#0.<<Initialize>>b__0_1(DirectoryInfo project) in C:\projects\export\build_scripts\bundle.csx:line 41
at System.Threading.Tasks.Parallel.<>c__DisplayClass33_0`2.<ForEachWorker>b__0(Int32 i)
at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
at System.Threading.Tasks.TaskReplicator.Replica`1.ExecuteAction(Boolean& yieldedBeforeCompletion)
at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---
---> (Inner Exception #2) System.IO.Compression.ZLibException: The underlying compression routine could not be loaded correctly.
---> System.EntryPointNotFoundException: Unable to find an entry point named 'CompressionNative_DeflateInit2_' in DLL 'clrcompression.dll'.
at Interop.zlib.DeflateInit2_(ZStream& stream, CompressionLevel level, CompressionMethod method, Int32 windowBits, Int32 memLevel, CompressionStrategy strategy)
at System.IO.Compression.ZLibNative.ZLibStreamHandle.DeflateInit2_(CompressionLevel level, Int32 windowBits, Int32 memLevel, CompressionStrategy strategy)
at System.IO.Compression.ZLibNative.CreateZLibStreamForDeflate(ZLibStreamHandle& zLibStreamHandle, CompressionLevel level, Int32 windowBits, Int32 memLevel, CompressionStrategy strategy)
at System.IO.Compression.Deflater..ctor(CompressionLevel compressionLevel, Int32 windowBits)
--- End of inner exception stack trace ---
at System.IO.Compression.Deflater..ctor(CompressionLevel compressionLevel, Int32 windowBits)
at System.IO.Compression.DeflateStream.InitializeDeflater(Stream stream, Boolean leaveOpen, Int32 windowBits, CompressionLevel compressionLevel)
at System.IO.Compression.DeflateStream..ctor(Stream stream, CompressionLevel compressionLevel, Boolean leaveOpen, Int32 windowBits)
at System.IO.Compression.DeflateStream..ctor(Stream stream, CompressionLevel compressionLevel, Boolean leaveOpen)
at System.IO.Compression.ZipArchiveEntry.GetDataCompressor(Stream backingStream, Boolean leaveBackingStreamOpen, EventHandler onClose)
at System.IO.Compression.ZipArchiveEntry.OpenInWriteMode()
at System.IO.Compression.ZipArchiveEntry.Open()
at Submission#0.<<Initialize>>b__0_1(DirectoryInfo project) in C:\projects\export\build_scripts\bundle.csx:line 41
at System.Threading.Tasks.Parallel.<>c__DisplayClass33_0`2.<ForEachWorker>b__0(Int32 i)
at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
at System.Threading.Tasks.TaskReplicator.Replica`1.ExecuteAction(Boolean& yieldedBeforeCompletion)
at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---
---> (Inner Exception #3) System.IO.Compression.ZLibException: The underlying compression routine could not be loaded correctly.
---> System.EntryPointNotFoundException: Unable to find an entry point named 'CompressionNative_DeflateInit2_' in DLL 'clrcompression.dll'.
at Interop.zlib.DeflateInit2_(ZStream& stream, CompressionLevel level, CompressionMethod method, Int32 windowBits, Int32 memLevel, CompressionStrategy strategy)
at System.IO.Compression.ZLibNative.ZLibStreamHandle.DeflateInit2_(CompressionLevel level, Int32 windowBits, Int32 memLevel, CompressionStrategy strategy)
at System.IO.Compression.ZLibNative.CreateZLibStreamForDeflate(ZLibStreamHandle& zLibStreamHandle, CompressionLevel level, Int32 windowBits, Int32 memLevel, CompressionStrategy strategy)
at System.IO.Compression.Deflater..ctor(CompressionLevel compressionLevel, Int32 windowBits)
--- End of inner exception stack trace ---
at System.IO.Compression.Deflater..ctor(CompressionLevel compressionLevel, Int32 windowBits)
at System.IO.Compression.DeflateStream.InitializeDeflater(Stream stream, Boolean leaveOpen, Int32 windowBits, CompressionLevel compressionLevel)
at System.IO.Compression.DeflateStream..ctor(Stream stream, CompressionLevel compressionLevel, Boolean leaveOpen, Int32 windowBits)
at System.IO.Compression.DeflateStream..ctor(Stream stream, CompressionLevel compressionLevel, Boolean leaveOpen)
at System.IO.Compression.ZipArchiveEntry.GetDataCompressor(Stream backingStream, Boolean leaveBackingStreamOpen, EventHandler onClose)
at System.IO.Compression.ZipArchiveEntry.OpenInWriteMode()
at System.IO.Compression.ZipArchiveEntry.Open()
at Submission#0.<<Initialize>>b__0_1(DirectoryInfo project) in C:\projects\export\build_scripts\bundle.csx:line 41
at System.Threading.Tasks.Parallel.<>c__DisplayClass33_0`2.<ForEachWorker>b__0(Int32 i)
--- End of stack trace from previous location ---
at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
at System.Threading.Tasks.TaskReplicator.Replica`1.ExecuteAction(Boolean& yieldedBeforeCompletion)
at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---
Metadata
Metadata
Assignees
Labels
No labels