-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
I have noted that updating nuget package Microsoft.AspNetCore.Connections.Abstractions to the latest version brakes website running in .Net 5.0. with SDK 5.0.403 when using the nuget package on gets the following exception when the site loads:
System.TypeLoadException: Could not load type 'Microsoft.AspNetCore.Connections.Experimental.IMultiplexedConnectionListenerFactory' from assembly 'Microsoft.AspNetCore.Connections.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
My workaround is to skip the latest NuGet package by conditionally linking my NuGet Package that supports both.net 5.0 and .net 6.0:
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Connections.Abstractions" Version="6.0.0" Condition="'$(TargetFramework)'=='net6.0'" />
<PackageReference Include="Microsoft.AspNetCore.Connections.Abstractions" Version="5.0.12" Condition="'$(TargetFramework)'!='net6.0'" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.RazorPages" Version="2.2.5" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="6.0.0" />
</ItemGroup>
I guess any user using my package in his application can update his consumed packages and override my hack running in the same issue so I am eager to figure out the correct way/package I need to resolve the issue.
Here is my stack:
Stack.txt