Skip to content

Microsoft.AspNetCore.Connections.Abstractions Version=6.0.0.0 brakes on dependency injection with .Net 5.0 #38246

@ASP-WAF

Description

@ASP-WAF

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions