.Net Core Console App Hostting Signalr Hub Causes GetStreamItemType does not have implementation exception

2

I'm trying to host a Signalr hub in my .NET Core 3.0 console application. What I coded is as follows. When I run I got "GetStreamItemType does not have implementation" exception.

static void Main(string[] args)
{
     BuildWebHost(args).Run();
}

public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args).UseStartup<Startup>().Build();

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddSignalR(); 
    }

    public void Configure(IApplicationBuilder app, Microsoft.Extensions.Hosting.IHostEnvironment env)
    {
        app.UseSignalR(routes =>  
        {
            routes.MapHub<Connector>("/connector");
        });
    }
}

Connector is my hub class derived from Microsoft.AspNetCore.SignalR.Hub When the app starts I get following exception and cannot figure out why.

System.TypeLoadException
  HResult=0x80131522
  Message=Method 'GetStreamItemType' in type 'Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1' from assembly 'Microsoft.AspNetCore.SignalR.Core, Version=1.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation.
  Source=Microsoft.AspNetCore.SignalR.Core
  StackTrace:
   at Microsoft.Extensions.DependencyInjection.SignalRDependencyInjectionExtensions.AddSignalRCore(IServiceCollection services) in /_/src/Microsoft.AspNetCore.SignalR.Core/SignalRDependencyInjectionExtensions.cs:line 36
.net-core
signalr
asked on Stack Overflow Oct 2, 2019 by Demir

2 Answers

1

When this error is thrown ensure you have the same version of Microsoft.AspNetCore.SignalR and Microsoft.AspNetCore.SignalR.Client

answered on Stack Overflow Oct 29, 2019 by 3dd
0

I gave up while searching the reason and trying to understand GetStreamItemType exception. Finally I created a blank .NET Core Web App and transferred my code from console app into this new app.

answered on Stack Overflow Oct 9, 2019 by Demir

User contributions licensed under CC BY-SA 3.0