mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
[PR #621] [MERGED] Add net461 target to clean up issues with system.* nuget dependencies #1132
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?
📋 Pull Request Information
Original PR: https://github.com/adamhathcock/sharpcompress/pull/621
Author: @inthemedium
Created: 9/29/2021
Status: ✅ Merged
Merged: 10/2/2021
Merged by: @adamhathcock
Base:
master← Head:master📝 Commits (3)
1561bbaAdd net462 target to clean up issues with system.* nuget dependencies01f7336Based on docs, the target should bet net4616983e66Fix preprocessor condition📊 Changes
9 files changed (+20 additions, -18 deletions)
View changed files
📝
src/SharpCompress/Algorithms/Alder32.cs(+5 -5)📝
src/SharpCompress/Common/ArchiveEncoding.cs(+1 -1)📝
src/SharpCompress/Compressors/BZip2/BZip2Stream.cs(+2 -2)📝
src/SharpCompress/Compressors/LZMA/LZipStream.cs(+1 -1)📝
src/SharpCompress/Crypto/Crc32Stream.cs(+1 -1)📝
src/SharpCompress/IO/NonDisposingStream.cs(+2 -2)📝
src/SharpCompress/Polyfills/StreamExtensions.cs(+1 -1)📝
src/SharpCompress/Polyfills/StringExtensions.cs(+1 -1)📝
src/SharpCompress/SharpCompress.csproj(+6 -4)📄 Description
Reason for change
.NET has a few known issues for libraries that depend on
System.*and only ship anetstandard2.0targetnetstandard2.0versusnet461(see #591). Unless assembly binding redirects are carefully applied, there will be runtime errors.Given the two issues above official guidance is (see reference 1)
So this PR takes the above guidance to make it easier for those of us still stuck on .NET Framework < 4.7.2 :-)
Example from my recent experience
Due to the recent CVE, I upgraded
SharpCompressto version0.29. Our code is mostly.NETFramework, so we unfortunately havePackageReferencestoSystem.MemoryandSystem.Buffers. Everything appeared to be fine, however at runtime things were failing left and right because most of our projects/nuget dependencies require the latestSystem.MemoryandSystem.BufferswhileSharpCompressrequires older versions. This is all avoid requiring anetstardard2.0assembly that has an assembly version of4.0.3.0(see #591 ) .After making my change, I found that
.NETFrameworkprojects work flawlessly without any tricky assembly binding redirects.References
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.