Skip to content

Comments

Downgrade Microsoft.Bcl.AsyncInterfaces to 8.0.0 for .NET Framework 4.8 compatibility#1225

Closed
Copilot wants to merge 73 commits intoreleasefrom
copilot/fix-7zip-opening-issue
Closed

Downgrade Microsoft.Bcl.AsyncInterfaces to 8.0.0 for .NET Framework 4.8 compatibility#1225
Copilot wants to merge 73 commits intoreleasefrom
copilot/fix-7zip-opening-issue

Conversation

Copy link
Contributor

Copilot AI commented Feb 17, 2026

Version 10.0.0 of Microsoft.Bcl.AsyncInterfaces causes assembly binding conflicts on .NET Framework 4.8 and .NET 10.0, preventing archives from being opened with ArchiveFactory.OpenArchive():

System.IO.FileLoadException: Could not load file or assembly Microsoft.Bcl.AsyncInterfaces, 
Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 or one of its dependencies. 
The manifest definition of the found assembly does not match the assembly reference.

Changes

  • Downgraded Microsoft.Bcl.AsyncInterfaces from 10.0.0 to 8.0.0 in Directory.Packages.props
  • Package lock files updated to reflect new dependency graph

Version 8.0.0 maintains all required functionality while resolving the binding conflict for legacy framework targets (net48, netstandard2.0).

Original prompt

This section details on the original issue you should resolve

<issue_title>0.45.1: can't open 7zip using ArchiveFactory.OpenArchive()</issue_title>
<issue_description>The following 7zip file can't be opened using ArchiveFactory.OpenArchive() in version 0.45.1.
It worked in older version.

The exception I get:

Exception thrown: 'System.IO.FileLoadException' in SharpCompress.dll
An unhandled exception of type 'System.IO.FileLoadException' occurred in SharpCompress.dll

Could not load file or assembly Microsoft.Bcl.AsyncInterfaces, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 or one of its dependencies. The manifest definition of the found assembly does not match the assembly reference. (HRESULT exception: 0x80131040)

File: (please extract the ZIP file first to get the 7ZIP file)

cheat.zip</issue_description>

Comments on the Issue (you are @copilot in this section)

@adamhathcock What was the code you used for this?

What platform?</comment_new>
<comment_new>@adamhathcock
It's weird because I've got a windows 11 machine with my .NET 4.8 test and it's fine loading things.

Are you sure there's not a conflict somewhere else? Are you using package locks to see what versions you're downloading?

I have no problem downgrading things but I just want to make sure this is a real problem vs a config issue somewhere else with the legacy framework</comment_new>
<comment_new>@adamhathcock
If you explicitly add Microsoft.Bcl.AsyncInterfaces as a dependency does that help? Try versions 10 and 8</comment_new>
<comment_new>@adamhathcock
I meant version 10.0.0 like it's asking for.

There's a dependency problem here and I'm not sure how to solve it with your older set up.

ZtdSharp is only used by older versions. You shouldn't need it anymore.</comment_new>
<comment_new>@adamhathcock
which older version works for you as-is?</comment_new>
<comment_new>@adamhathcock

I'm now getting the same issue with NET 10.0 on 0.46.1 (but not with NET 4.8).

Adding an explicit reference to Microsoft.Bcl.AsyncInterfaces to my csproj fixes the issue.

So this is happening with dotnet 10 and windows?

Weird it's requiring it for that. I'll check the way things are referenced.

Maybe another package was using an older version and needed it?

Any chance for a sample project that caused the issue for you?</comment_new>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

adamhathcock and others added 30 commits February 6, 2026 21:07
…compressions

# Conflicts:
#	src/SharpCompress/Archives/GZip/GZipArchive.Async.cs
#	src/SharpCompress/Archives/GZip/GZipArchive.cs
#	src/SharpCompress/Archives/Zip/ZipArchive.Async.cs
#	src/SharpCompress/Archives/Zip/ZipArchive.cs
#	src/SharpCompress/Common/GZip/GZipEntry.Async.cs
#	src/SharpCompress/Common/GZip/GZipEntry.cs
#	src/SharpCompress/Common/Options/IReaderOptions.cs
#	src/SharpCompress/Readers/ReaderOptions.cs
#	src/SharpCompress/Readers/Zip/ZipReader.Async.cs
#	src/SharpCompress/Readers/Zip/ZipReader.cs
#	src/SharpCompress/Writers/GZip/GZipWriterOptions.cs
# Conflicts:
#	tests/SharpCompress.Performance/Benchmarks/TarBenchmarks.cs
#	tests/SharpCompress.Performance/Benchmarks/ZipBenchmarks.cs
#	tests/SharpCompress.Performance/baseline-results.md
… Unknown

Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
…pe-entry

Fix CompressionType for WinZip AES encrypted ZIP entries
… Framework 4.8 compatibility

Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix 7zip opening issue in ArchiveFactory Downgrade Microsoft.Bcl.AsyncInterfaces to 8.0.0 for .NET Framework 4.8 compatibility Feb 17, 2026
Copilot AI requested a review from adamhathcock February 17, 2026 10:32
@adamhathcock adamhathcock marked this pull request as ready for review February 17, 2026 10:33
Copilot AI review requested due to automatic review settings February 17, 2026 10:33
@kiloconnect
Copy link
Contributor

kiloconnect bot commented Feb 17, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR downgrades Microsoft.Bcl.AsyncInterfaces from version 10.0.0 to 8.0.0 to resolve assembly binding conflicts that prevented SharpCompress from opening archives on .NET Framework 4.8 and .NET 10.0. Version 10.0.0 caused FileLoadException when calling ArchiveFactory.OpenArchive(), affecting core library functionality.

Changes:

  • Downgraded Microsoft.Bcl.AsyncInterfaces from 10.0.0 to 8.0.0 in centralized package management
  • Updated package lock files to reflect the new dependency graph, including the transitive downgrade of System.Threading.Tasks.Extensions from 4.6.3 to 4.5.4

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
Directory.Packages.props Changed Microsoft.Bcl.AsyncInterfaces version from 10.0.0 to 8.0.0 in central package version management
src/SharpCompress/packages.lock.json Updated resolved package versions for .NET Framework 4.8 and .NET Standard 2.0 targets, including transitive dependency updates
tests/SharpCompress.Test/packages.lock.json Updated test project package lock to match new dependency versions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@adamhathcock adamhathcock changed the base branch from master to release February 17, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0.45.1: can't open 7zip using ArchiveFactory.OpenArchive()

2 participants