asp.net – .NET Signalr MapConnection已经过时了?

我是新来的.Net和SignalR.我正在看一个前同事编写的代码,他把这行添加到Route Config中,现在抛出错误说它已经过时了,但是所有的 documentation我已经以这种方式阅读了建议的映射连接.
namespace FailureInvestigationToolbox {
public class RouteConfig {
    public static void RegisterRoutes( RouteCollection routes ) {
        routes.IgnoreRoute( "{resource}.axd/{*pathInfo}" );

        routes.MapRoute(
            name :"Default",url :"{controller}/{action}/{id}",defaults :new {
                controller = "fit",action = "Index",id = UrlParameter.Optional
            }
        );

        RouteTable.Routes.MapConnection<TaskListPersistence>("taskpersist","/taskpersist");
    }
}
}

错误是:

System.Web.Routing.SignalRRouteExtensions.MapConnection<T>    
(System.Web.Routing.RouteCollection,string,string)' is obsolete: 
'Use IAppBuilder.MapSignalR<TConnection> in an Owin Startup class. See
http://go.microsoft.com/fwlink/?LinkId=320578 for more details.'  
C:\fit\FailureInvestigationToolbox\App_Start\RouteConfig.cs

是否可能我的SignalR安装有问题,或者是IAppBuilder的方法来映射我应该做什么?如果是这样做的话?

我正在使用SignalR 2.0.3

解决方法

是的,你必须使用IAppBuilder.添加Owin启动类,并在其配置方法中调用MapConnection< T>在你收到的应用程序参数上.这应该工作.检查 herehere.

相关文章

### 创建一个gRPC服务项目(grpc服务端)和一个 webapi项目(...
一、SiganlR 使用的协议类型 1.websocket即时通讯协议 2.Ser...
.Net 6 WebApi 项目 在Linux系统上 打包成Docker镜像,发布为...
一、 PD简介PowerDesigner 是一个集所有现代建模技术于一身的...
一、存储过程 存储过程就像数据库中运行的方法(函数) 优点:...
一、Ueditor的下载 1、百度编辑器下载地址:http://ueditor....