asp.net-core-signalr

Get Hub Context in SignalR Core from within another object

安稳与你 提交于 2019-12-01 01:11:37
问题 I am using Microsoft.AspNetCore.SignalR (latest release) and would like to get the hub context from within another object that's not a Controller . In the "full" SignalR, I could use GlobalHost.ConnectionManager.GetHubContext<MyCoolHub>(); I have seen a lot of examples of just adding Microsoft.AspNetCore.SignalR.IHubContext<MyCoolHub> as a parameter to the Ctor of a Controller , but no examples (that work) for otherwise. ETA: So, this is what I have working. Is this hacky? public class MyHub

SignalR Core 2.2 CORS AllowAnyOrigin() breaking change

我是研究僧i 提交于 2019-11-28 03:28:24
问题 To connect via SignalR to an ASP.NET Core 2.1 server from any origin, we had to configure the pipeline as follows: app.UseCors ( builder => builder .AllowAnyHeader () .AllowAnyMethod () .AllowAnyOrigin () .AllowCredentials () ) According to this document, ASP.NET Core 2.2 no longer allows the combination of AllowAnyOrigin and AllowCredentials, so what would be the solution? Whereas the SignalR Core always sends withCredentials:true in the XMLHtppRequest. What I need is that from any origin

SignalR version compatability (StatusCode: 405 'Method Not Allowed')

僤鯓⒐⒋嵵緔 提交于 2019-11-28 01:57:56
I'm having issues with a SignalR project I'm currently working on. I'm trying to build a server using .Net Core, and a client using traditional .Net (framework 4.6.1). However the server and client don't seem to be compatible. The last issue I've run into is a StatusCode: 405, ReasonPhrase: 'Method Not Allowed'. I found an answer on GitHub that states that there are many breaking changes between versions. Looking at the NuGet package versions available, I get even more confused. for the .Net Core server I'm using 1.0.0-preview1-final. There's also a 1.0.0-alpha2-final available, but I have no

SignalR Core 2.2 CORS AllowAnyOrigin() breaking change

ぐ巨炮叔叔 提交于 2019-11-28 01:20:33
To connect via SignalR to an ASP.NET Core 2.1 server from any origin, we had to configure the pipeline as follows: app.UseCors ( builder => builder .AllowAnyHeader () .AllowAnyMethod () .AllowAnyOrigin () .AllowCredentials () ) According to this document, ASP.NET Core 2.2 no longer allows the combination of AllowAnyOrigin and AllowCredentials, so what would be the solution? Whereas the SignalR Core always sends withCredentials:true in the XMLHtppRequest. What I need is that from any origin and without credentials, our users can connect to the SignalR Hub. There is a workaround, change

SignalR version compatability (StatusCode: 405 'Method Not Allowed')

时光毁灭记忆、已成空白 提交于 2019-11-27 04:51:26
问题 I'm having issues with a SignalR project I'm currently working on. I'm trying to build a server using .Net Core, and a client using traditional .Net (framework 4.6.1). However the server and client don't seem to be compatible. The last issue I've run into is a StatusCode: 405, ReasonPhrase: 'Method Not Allowed'. I found an answer on GitHub that states that there are many breaking changes between versions. Looking at the NuGet package versions available, I get even more confused. for the .Net

Call SignalR Core Hub method from Controller

廉价感情. 提交于 2019-11-26 11:21:49
How can I call SignalR Core Hub method from Controller? I am using ASP.NET Core 2.0 with Microsoft.AspNetCore.SignalR (1.0.0-alpha2-final). I have windows service which communicate with Excel, SolidEdge ... When operation is complete it post request to my controller in ASP.NET Core application. Now I need to inform all clients connected to server with SignalR that external program completed some task. I can not change the way window service works. (Can not connect to SignalR from window service). I found plenty solution for old SignalR ( GlobalHost.ConnectionManager.GetHubContext ), but much

Call SignalR Core Hub method from Controller

主宰稳场 提交于 2019-11-26 02:22:37
问题 How can I call SignalR Core Hub method from Controller? I am using ASP.NET Core 2.0 with Microsoft.AspNetCore.SignalR (1.0.0-alpha2-final). I have windows service which communicate with Excel, SolidEdge ... When operation is complete it post request to my controller in ASP.NET Core application. Now I need to inform all clients connected to server with SignalR that external program completed some task. I can not change the way window service works. (Can not connect to SignalR from window