Mohammad Shadmehr
Mohammad Shadmehr

Reputation: 685

AspNetCore.SignalR: 'IClientProxy' does not contain a definition for 'InvokeAsync'

I have successfully integrated SignalR.AspNetCore into my AbpZero template. everything works fine. However when I tried to add a hub into my application like what has been described in the document, I am getting the following error on

public async Task SendMessage(string message)
{
    await Clients.All.InvokeAsync("getMessage", string.Format("User {0}: {1}", AbpSession.UserId, message));
}

Error CS1061 'IClientProxy' does not contain a definition for 'InvokeAsync' and no extension method 'InvokeAsync' accepting a first argument of type 'IClientProxy' could be found (are you missing a using directive or an assembly reference?)

Upvotes: 6

Views: 7651

Answers (1)

Lryd
Lryd

Reputation: 126

Using SendAsync() worked for me. I am using this package: <PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.0.0-preview2-30138" /> The reason I am using it is because when I added the new client to my Angular project, that is the package npm served. The packages have to match at this time.

Upvotes: 11

Related Questions