asp.net-core-signalr

How do you get a reference to an ASP.NET Core SignalR hub context outside of a controller?

被刻印的时光 ゝ 提交于 2020-01-06 06:02:57
问题 I have just started using SignalR for ASP.NET Core. I have used SignalR for ASP.NET for a couple of years. I am using: Microsoft.AspNetCore.All 2.0.7 Microsoft.AspNetCore.SignalR 1.0.0-preview2-final Microsoft.AspNetCore.SignalR.Client 1.0.0-preview2-final It appears that in the ASP.NET Core version of SignalR I can no longer use GlobalHost or IConnectionManager to get a reference to a hub context. I can use DI to get a reference to the hub context in a controller without any problems. public

SignalR class library for both UWP and WPF

陌路散爱 提交于 2020-01-06 04:59:06
问题 I'm interested in writing a class library that can be consumed from both a UWP application and a WPF (desktop) application. This library will incorporate SignalR to allow those two application types to function as servers pushing data. The client will most likely be another UWP application. According to Microsoft in such cases the class library should target .NET Standard. My current understanding is that .NET Core is an implementation of the .NET Standard. Since SignalR has now been included

Get SignalrR ConnectionId on ClientSide (Angular App)

感情迁移 提交于 2020-01-03 07:22:32
问题 Hi I'm using an angular app to connect to signalr, I am using "@aspnet/signalr": "1.0.0-preview1-final". I need to send the connectionId to my controller (I need to do some process and tell all others clients but no the user making the request), the problem is Connection Id is private, there is a way to get the connection Id? 回答1: Seems like an XY problem. Tell all other clients (problem X) Hub: public async Task TellAllOtherClients(object[] args) { await Clients.Others.SendAsync("method",

ASP.NETCore Signalr not work on AWS

浪子不回头ぞ 提交于 2020-01-02 04:06:13
问题 We have two applications, server-side (.Net Core 2.0) and client side (AngulerJs) that they are hosted on AWS elistic container service, also, there is a layer of cloud flare, in addition, we are using an ALB that is pointing to our docker containers. Our solution should have a real time services which pushs data to the client side, so we used asp net core signalr version = "1.0.0-alpha2-final" for this purpose. The problem is, the signalr is working fine when we test it in localhost but when

ASP.NETCore Signalr not work on AWS

痞子三分冷 提交于 2020-01-02 04:06:06
问题 We have two applications, server-side (.Net Core 2.0) and client side (AngulerJs) that they are hosted on AWS elistic container service, also, there is a layer of cloud flare, in addition, we are using an ALB that is pointing to our docker containers. Our solution should have a real time services which pushs data to the client side, so we used asp net core signalr version = "1.0.0-alpha2-final" for this purpose. The problem is, the signalr is working fine when we test it in localhost but when

Using SignalR Core to send messages from a Controller Method to Angular

。_饼干妹妹 提交于 2020-01-01 09:55:11
问题 I'm trying to use SignalR for Asp Net Core 2.1 in order to send a message from a controller method which call is triggered from a test button in Angular. The behavior I'd expect is that when I click the button, my service invokes the controller method, which sends the test message. Then, I will simply log the message. I want to manage this in a service in order to avoid code duplication in all of the components. I've read some examples like this question about using SignalR in a service (I've

JMeter WebSocket plugin - Close SignalR connection

杀马特。学长 韩版系。学妹 提交于 2019-12-24 19:29:04
问题 I've a website using Asp.NET Core SignalR to dynamically load data from the server. I use JMeter to do functional tests on this page. I use the WebSocket sampler plugin in version 1.2.1 to test the SignalR functionality. Following this blazemeter tutorial on how to use JMeter with the WebSocket sampler plugin I get always an error when trying to close the SignalR connection. My JMeter sampler setup looks like: WebSocket Open Connection WebSocket request-response Sampler WebSocket Single Read

Does SignalR or websockets works with ASP.NET CORE 1.0?

不羁岁月 提交于 2019-12-24 17:07:50
问题 I need to implement realtime data sharing push based to my asp.net core 1.0 web application. i.e. If any new data is available I want to push it to all the connected clients/logged in users. I was considering SignalR & websockets for it but SignalR works on .net core 2.0 and websockets works on .net core 1.1 version. Here is the configuration in my csproj file <PropertyGroup> <TargetFramework>netcoreapp1.0</TargetFramework> <RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>

How to validate Azure AD B2C token from query string in Asp.net Core?

我是研究僧i 提交于 2019-12-24 07:26:18
问题 I have a asp.net web api application with some controllers and a signalR hub. JWT tokens validation with Azure AD B2C is configured like this: services.AddAuthentication(AzureADB2CDefaults.JwtBearerAuthenticationScheme) .AddAzureADB2CBearer(options => _configuration.Bind("AzureAdB2C", options)) This works fine with controllers, and I don't have to worry about the intricacies of Azure AD B2C token validation. Now, for the signalR hub to support Web Sockets or Server-sent events, the

asp.net core 2.1 preview 2 - signalR CORS issues and 405 on OPTIONS request

若如初见. 提交于 2019-12-23 19:32:18
问题 Using the latest versions of signalR and @aspnet/signalr I still get issues connecting. I'm fairly sure the versions are exactly the same. I've been following the startup project here. But instead I'm using an Angular 5 application. I get issues with CORS headers and more specifically the OPTIONS request returns a 405 method not allowed. Visual studio version here. Typescript/javascript client version here 回答1: I faced same issue and it appeared that order matters. Make sure you've put it