MVC5 使用SignalR记录

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(); } } }
小人才疏学浅,看官不喜勿喷,谢谢
原文地址:https://www.cnblogs.com/feiqilai/p/15572322.html