Strongly Typed SignalR TypeLoadException Hub

I encounter a TypeLoadException exception when I use a strongly typed hub. My interface:

public interface IClientCallback
{
    void callback<T>(T msg, string eventType);
    void test(string msg, string eventType); 
}

All methods are inside one interface, and the interface is not inherited from any other interface.

My Hub Class:

public class ServiceHub : Hub<IClientCallback>
{
    public static readonly string ServiceHubName = "ServiceHub";

    public void Register(string name, string eventType)
    {
        Clients.All.test("hello", "world");
    }
}

When I use my client application to call the Register method in the hub, in the hub application I get an exception when it is in Clients.All.test (...):

The TypeLoadException "callback" method of type 'Microsoft.AspNet.SignalR.Hubs.TypedClientBuilder.IClientCallbackImpl' from the assembly 'Microsoft.AspNet.SignalR.Hubs.TypedClientBuilder, Version = 0.0.0.0, Culture = neutral, PublicKeyToken = null' does not implementation.

, . .

+4

Source: https://habr.com/ru/post/1615843/


All Articles