mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
After upgrading Sharpcompress from 0.33.0 to 0.34.0, error when decompressing a ZipStream #591
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @hmoraes on GitHub (Sep 22, 2023).
Hello,
I have been using Sharpcompress in a file decompression flow in my project (any format supported by Sharpcompress). My implementation receives a Stream which is passed to Sharpcompress using the implementation below:
Until version 0.33.0, decompressing a Stream from a Zip file was working perfectly. When upgrading to version 0.34.0 (with ZstdSharp support) the following exception started to be thrown:
I have some unit tests in this function in which I validate the uncompressed files from the attached Zip. The test consists of checking the decompression of files with accentuation.
teste-arquivo-compactado.zip
My project is in .Net7.0. Do I have to make any corrections to my implementation?
@adamhathcock commented on GitHub (Sep 23, 2023):
it seems like you're missing the dependency....this should be resolved via nuget
@Sicos1977 commented on GitHub (Sep 28, 2023):
I have the latest version from nuget and have the exact same issue. I'm not missing the zstdSharp.Port dependency.
I'm on .net 4.8.1
@Sicos1977 commented on GitHub (Sep 28, 2023):
It seems the signature has changed this year on the DecompressionStream.
When downgrading to version zstdSharp 6.0 the problem went away.
https://github.com/oleg-st/ZstdSharp/blob/master/src/ZstdSharp/DecompressionStream.cs
So I guess you need to upgrade the package version you are using.
I don't mind an older version but then at least at a dependency on the nuget package that says you need to use version 6.0
@adamhathcock commented on GitHub (Sep 28, 2023):
are you not recompiling?
@Sicos1977 commented on GitHub (Sep 28, 2023):
How do you mean. I always recompile the code after upgrading nuget packages
Your current package on nuget just expect another signature because a few optional parameters are added to de DecompressionStream.
@leandroconsiglio commented on GitHub (Sep 28, 2023):
Same problem here

@hmoraes commented on GitHub (Sep 28, 2023):
The exception is very strange because it only happens in my project. I created another ConsoleApp and implemented the same function. Worked perfectly.
I'm trying to bring usage dependencies or other attached projects to ConsoleApp, but it keeps working.
@adamhathcock commented on GitHub (Sep 29, 2023):
does it have to do with what your target is? maybe it should be included for everything?
@rodesfl commented on GitHub (Sep 30, 2023):
I have the exact same problem, here is how I fixed:
I have two services using this library, one of them is on premise at my clients, the other is on the server. When I updated the server version (0.34.0) I began to get this error, and the reason is that I'm trying to decompress a file using .34 that was compressed using .33.
When I downgraded my server to .33 the problem was fixed, so I guess there is a backward compatibily problem there. No big deal, but it is going to be a pain to update my clients and server at the same time.
@hmoraes @Sicos1977 @leandroconsiglio
@adamhathcock commented on GitHub (Oct 2, 2023):
I released 0.34.1 which updates the zstd assembly.
I may pull the dependency into the lib as I done with other things
https://github.com/adamhathcock/sharpcompress/releases/tag/0.34.1
@hmoraes commented on GitHub (Oct 2, 2023):
@rodesfl My solution contains 5 projects and the SharpCompress dependency is only installed in the base library project
@adamhathcock I tested the new version 0.34.1 and the problem was resolved. Now it's working perfectly. Thank you very much!
@rodesfl commented on GitHub (Oct 2, 2023):
Awesome, thank you.