mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 05:25:00 +00:00
SharpCompress 0.28.1 depends on System.Buffers 4.4.0, but NuGet transitively depends on 4.5.1 #453
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 @schlotter on GitHub (Apr 13, 2021).
Bug description
Using SharpCompress 0.28.1 in a .NET 4.6.2 unit test project I get the following exception:
Analysis
Build output
The detailed MSBuild output of building the test project shows:
Dependency of SharpCompress 0.28.1 (.NET Standard 2.0) assembly
Disassembling the SharpCompress 0.28.1 assembly with ildasm shows that it indeed references
"System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51":Dependency of SharpCompress 0.28.1 NuGet package
The SharpCompress 0.28.1 NuGet package depends on System.Buffers in the following way:
SharpCompress 0.28.1 → >= System.Memory 4.5.4 → >= System.Buffers 4.5.1
Signature of System.Buffers 4.4.0
Disassembling System.Buffers 4.4.0 NuGet package with ildasm, we get the following signature:
Signature of System.Buffers 4.5.1
Disassembling System.Buffers 4.5.1 NuGet package with ildasm, we get the following signature:
Conclusion
The .NET Standard 2.0 assembly of
SharpCompress.dllwhich is contained in the SharpCompress 0.28.1 NuGet package depends onSystem.Buffers.dllwhich is contained in the System.Buffers 4.4.0 NuGet package (assembly version 4.0.2.0).This creates a version conflict because the SharpCompress 0.28.1 NuGet package transitively depends on the System.Buffers 4.5.1 NuGet package (assembly version 4.0.3.0).
Workaround
I was able to work around this issue by forcing the System.Buffers NuGet version to 4.4.0:
The drawback is that it generates the following warning: