Skip to content

Commit 6c695e3

Browse files
committed
Fix bug caused by System.Threading.Tasks v4.7.1
Unfortunately `System.Threading.Tasks` v4.7.1 is broken. Its package manifest states that it depends on `System.Threading.Tasks.Extensions` >= v4.5.4 (assembly version v4.2.0.1); however, for some reason it actually requests v4.2.0.0. While neither OmniSharp nor PowerShell Editor Services, the downstream library where this bug appeared, ship that version of the library, it can sometimes be found in the Global Assembly Cache on Windows. When present (due to an installation by some other program), it gets loaded, and then other dependencies (correctly) request v4.2.0.1 which also gets loaded. When both are loaded, a `System.MissingMethodException` is thrown! Specifically the method `ChannelReader.ReadAsync` (from `System.Threading.Tasks`) on the type `Tasks.ValueTask` (provided by `System.Threading.Tasks.Extensions`) can no longer be resolved. I do not know enough about the intricacies of method/type resolution in the full .NET Framework as to explain precisely why the presence of v4.2.0.0 causes this resolution to fail, but it certainly does. Upgrading `System.Threading.Tasks` to v6.0.0 is confirmed to solve the problem, since the newer package correctly requests `System.Threading.Tasks.Extensions` v4.2.0.1.
1 parent 20ed43b commit 6c695e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: Directory.Packages.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<PackageVersion Include="coverlet.msbuild" Version="3.1.2" />
5050
<PackageVersion Include="System.Reactive" Version="5.0.0" />
5151
<PackageVersion Include="System.Collections.Immutable" Version="5.0.0" />
52-
<PackageVersion Include="System.Threading.Channels" Version="4.7.1" />
52+
<PackageVersion Include="System.Threading.Channels" Version="6.0.0" />
5353
<PackageVersion Include="Microsoft.Reactive.Testing" Version="5.0.0" />
5454
<PackageVersion Include="MediatR" Version="8.1.0" />
5555
<PackageVersion Include="Bogus" Version="34.0.2" />

0 commit comments

Comments
 (0)