3

Using .Net Core Signal R, Azure SignalR. Code used to work. Stopped working.

Fails at await MyHubConnection.StartAsync();

Throws exception System.TypeLoadException: 'Method 'GetStreamItemType' in type 'ConnectionState' from assembly 'Microsoft.AspNetCore.SignalR.Client.Core, Version=1.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation.'

Microsoft.AspNetCore.SignalR.Client v 1.1.0 Microsoft.Azure.SignalR 1.0.7

How to to fix this?

Thanks!

Adam Leffert www.leffert.com

MindModel
  • 822
  • 1
  • 10
  • 22

3 Answers3

6

In case anyone else runs into this problem, I'm posting the answer here.

I was able to work around this problem by updating all SignalR and related NUGet packages to their version 3.x pre-release versions.

MindModel
  • 822
  • 1
  • 10
  • 22
3

I recently migrated a .net core 2.2.x app to framework 3.1. I experienced the same issue. the problem is version mismatch between Microsoft.AspNetCore.SignalR and Microsoft.AspNetCore.SignalR.Client.

To work properly the server must have SignalR 1.1.0

https://www.nuget.org/packages/Microsoft.AspNetCore.SignalR/1.1.0

In terms of the client, it must be the most recent one, even when the previous one still works:

https://www.nuget.org/packages/Microsoft.AspNetCore.SignalR.Client/3.1.1

Other combinations of the client and server don't work or they have some unexpected behaviors.

Maximiliano Rios
  • 2,196
  • 2
  • 20
  • 34
0

Solution for NET 5 console app is just to use the meta-reference for ASP.NET 5.

Open your project and add this meta-reference (don't forget to remove old ASP.NET refs):

<ItemGroup>
    <FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
TheAccessMan
  • 133
  • 10