AspNetCore.SignalR:'IClientProxy' 不包含 'InvokeAsync' 的定义
AspNetCore.SignalR: 'IClientProxy' does not contain a definition for 'InvokeAsync'
我已成功将 SignalR.AspNetCore 集成到我的 AbpZero 模板中。一切正常。但是,当我尝试像 document 中描述的那样将集线器添加到我的应用程序时,我在
上收到以下错误
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?)
使用 SendAsync() 对我有用。我正在使用这个包:
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.0.0-preview2-30138" />
我使用它的原因是因为当我将新客户端添加到我的 Angular 项目时,npm 服务的就是这个包。此时必须匹配包。
我已成功将 SignalR.AspNetCore 集成到我的 AbpZero 模板中。一切正常。但是,当我尝试像 document 中描述的那样将集线器添加到我的应用程序时,我在
上收到以下错误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?)
使用 SendAsync() 对我有用。我正在使用这个包:
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.0.0-preview2-30138" />
我使用它的原因是因为当我将新客户端添加到我的 Angular 项目时,npm 服务的就是这个包。此时必须匹配包。