1.安装以下安装包
还有下面这个可以加载js文件10
2.web项目增加以下类
using Microsoft.AspNet.SignalR; using Microsoft.Owin; using Microsoft.Owin.Cors; using Owin; using System; using System.Collections.Generic; using System.Linq; using System.Web; [assembly: OwinStartup(typeof(XXXXX.Startup))] namespace XXXX { public class Startup { public void Configuration(IAppBuilder app) {
app.Map("/signalr", map =>
{
map.UseCors(CorsOptions.AllowAll); var hubConfiguration = new HubConfiguration { EnableJSONP = true }; map.RunSignalR(hubConfiguration); }); app.MapSignalR(); } } }