Asp.net mvc Can';信号机里没有运输工具

Asp.net mvc Can';信号机里没有运输工具,asp.net-mvc,signalr,Asp.net Mvc,Signalr,当我运行$.connection.hub.start()时,我从“资源”中得到这些错误(我跟踪了它) 这些是我遇到的错误 errorOnNegotiate -> "Error during negotiation request.". errorParsingNegotiateResponse -> "Error parsing negotiate response.". errorSourceError -> "Error raised by EventSource". ev

当我运行
$.connection.hub.start()
时,我从“资源”中得到这些错误(我跟踪了它)

这些是我遇到的错误

errorOnNegotiate -> "Error during negotiation request.".
errorParsingNegotiateResponse -> "Error parsing negotiate response.".
errorSourceError -> "Error raised by EventSource".
eventSourceFailedToConnect -> "EventSource failed to connect.".
longPollFailed -> "Long polling request failed.".
noConnectionTransport -> "Connection is in an invalid state, there is
no transport active.". nojQuery -> "jQuery was not found. Please
ensure jQuery is referenced before the SignalR client JavaScript
file.". noTransportOnInit -> "No transport could be initialized
successfully. Try specifying a different transport or none at all for
auto initialization.".

部分错误是:“未找到jQuery。请确保在SignalR客户端JavaScript文件之前引用了jQuery。”

您需要添加jQuery引用,可以这样做(请注意,在此示例中,signalR版本为2.0.2,您需要将正确的引用添加到您正在使用的版本):


看起来您已将resources对象的内容粘贴到signalR.\u0.error()中。该对象包含可能的错误列表,而不是您得到的错误。例如,这里它用于在无法解析协商响应时获取错误消息:

试试看{
res=连接。\u解析响应(结果);
}捕获(错误){
onFailed(信号器错误(resources.errorParsingNegotiateResponse,错误),连接);
回来

}
“找不到jQuery。请确保在Qualalr客户端JavaScript文件之前引用jQuery。“我正在使用jQuery -1.7.2.js,您知道可以使用哪种更高版本的jQuery吗?我已经使用了1.7。x和1.8。x和1.10Xi使用的包来加载jQuery(函数){ $.Calnnut.Hub日志= true;$ .CONTURCT.HUST.STATE())(})要在问题中添加代码,请转到问题并按编辑按钮
 <!--Reference the jQuery library. -->
 <script src="Scripts/jquery-1.6.4.min.js"></script>
 <!--Reference the SignalR library. -->
 <script src="Scripts/jquery.signalR-2.0.2.min.js"></script>