signalr

AspNetCore.SignalR : Cannot start a connection that is not in the Initial state

瘦欲@ 提交于 2020-01-13 13:04:08
问题 I have troubles to get my ASP.NET Core SignalR app working. I have this server-side code : public class PopcornHub : Hub { private int Users; public async Task BroadcastNumberOfUsers(int nbUser) { await Clients.All.InvokeAsync("OnUserConnected", nbUser); } public override async Task OnConnectedAsync() { Users++; await BroadcastNumberOfUsers(Users); await base.OnConnectedAsync(); } public override async Task OnDisconnectedAsync(Exception exception) { Users--; await BroadcastNumberOfUsers(Users

SignalR: Generated proxy vs. dynamically created hub file

喜欢而已 提交于 2020-01-13 05:38:08
问题 Is the output from the SignalR hub proxy generator essentially the same as the dynamically generated hub proxy file? If not, what are the differences? Some background on my question: I am struggling creating the hub proxy using the command line tool due to dependency issues during execution and I do think obtaining the dynamically generated file might be an easier way. 回答1: As stated on this ASP.NET page about using hubs with SignalR: The generated proxy and what it does for you You can

Using SignalR in ASP.NET Core 1.0

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-12 09:55:32
问题 We have an ASP.NET Core 1.0 RC1 application and we want to incorporate SignalR in it. However, SignalR is not yet a part of ASP.NET Core 1.0. Is there a way to still incorporate SignalR in our existing app or will we have to look into some other web sockets library such as socket.io? 回答1: Although SignalR 3 won't be a part of the 1.0 release of ASP.NET Core, you can still use SignalR in an ASP.NET Core web app project. In fact, check out this SignalR project on the official "aspnet" account

Using SignalR in ASP.NET Core 1.0

╄→гoц情女王★ 提交于 2020-01-12 09:51:26
问题 We have an ASP.NET Core 1.0 RC1 application and we want to incorporate SignalR in it. However, SignalR is not yet a part of ASP.NET Core 1.0. Is there a way to still incorporate SignalR in our existing app or will we have to look into some other web sockets library such as socket.io? 回答1: Although SignalR 3 won't be a part of the 1.0 release of ASP.NET Core, you can still use SignalR in an ASP.NET Core web app project. In fact, check out this SignalR project on the official "aspnet" account

Using ajaxSetup beforeSend for Basic Auth is breaking SignalR connection

拜拜、爱过 提交于 2020-01-12 05:23:26
问题 I have a WebApi secured with Basic Auth which is applied to the entire Api using a AuthorizationFilterAttribute. I also have SignalR Hubs sitting on several of my Api Controllers. Alongside this I have a web page which makes use of my WebApi. The web page is mostly written in Backbone, so in order to make calls to my secured WebApi, I have added the following jquery $.ajaxSetup({ beforeSend: function (jqXHR, settings) { jqXHR.setRequestHeader('Authorization', 'Basic ' + Token); return true; }

Angular 2 TypeScript using SignalR

丶灬走出姿态 提交于 2020-01-12 03:40:47
问题 I'm trying to set up an Angular 2 application to use Microsoft's SignalR. I've been following this tutorial, which although it's good I don't like the fact that jQuery and SignalR are loaded into the application via script tags in the index.html file and also the fact that both libraries do not use their respective Type Definitions. So with that in mind I've been trying to include jQuery and SignalR in my application using node modules and the respective Type Definitions. I've searched the

Angular 2 TypeScript using SignalR

依然范特西╮ 提交于 2020-01-12 03:40:07
问题 I'm trying to set up an Angular 2 application to use Microsoft's SignalR. I've been following this tutorial, which although it's good I don't like the fact that jQuery and SignalR are loaded into the application via script tags in the index.html file and also the fact that both libraries do not use their respective Type Definitions. So with that in mind I've been trying to include jQuery and SignalR in my application using node modules and the respective Type Definitions. I've searched the

Angular 2 and SignalR

ぐ巨炮叔叔 提交于 2020-01-12 03:31:07
问题 I am searching the inter webs for some examples of SignalR that is used with the beta version of Angular2? As i cannot seem to find examples that are using the beta version. One main question that i have is how to manually run change detection on the beta version of Angular 2? Thanks in advance 回答1: I recently wrote an article that demonstrates one way to integrate Angular 2 and SignalR using a "channel/event" model: https://blog.sstorie.com/integrating-angular-2-and-signalr-part-2-of-2/ I

SignalR without OWIN

。_饼干妹妹 提交于 2020-01-11 05:30:10
问题 I'm participating in the ASP MVC project. I want to use SignalR in the project but I don't want to use OWIN lib. As I understand, SignalR is registered in the application using this piece of code: public class Startup { public void Configuration(IAppBuilder app) { app.MapSignalR(); } } How can I modify this to remove the dependency to OWIN? I would like to use approach similar to RouteConfig.RegisterRoutes(RouteTable.Routes); 回答1: First be sure to Get-Package within the Package Manager

Include jQuery in Angular2 with webpack and access it from component

那年仲夏 提交于 2020-01-11 04:52:25
问题 I want to include jQuery and SignalR in my Angular2-Application and wire everything up with webpack. I therefore installed jQuery via npm. package.json "dependencies": { // ... "jquery": "2.1.4", // ... }, Files and folders are installed correctly. I now target these files in my vendor.ts to get webpack to find and include them: import 'jquery'; import 'bootstrap/dist/js/bootstrap.js'; import '../../bower_components/signalr/jquery.signalR'; And webpack gets these files and wires them up. I