HubException: Method does not exist. in signalr

mc 3,701 Reputation points
2021-09-30T03:00:01.717+00:00

I add the method but when use it there will be an error:

HubException: Method does not exist.

why?

public interface IResponse

{
 Task AddDeviceResponse(int id);
}

public class DeviceHub:Hub<IResponse>
{
    public async Task AddDevice(int id)
{
    await Clients.Caller.AddDeviceResponse(0);
}

}

when I call the AddDevice there will be the error why?

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,284 questions
{count} votes