Web チャット アプリケーションを開発していて、奇妙な問題が発生しています。アプリケーションはローカル マシンでは正常に動作していますが、リモート マシンでは動かなくなりました。
私の問題についての手がかりを提供する方法(問題を追跡するためのトリックがある場合はアドバイスしてください)、私が得た唯一のエラー$.connection.hub.error
は
Protocol error: Unknown transport.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Protocol error: Unknown transport.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: Protocol error: Unknown transport.]
Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(HostContext context) +866
Microsoft.AspNet.SignalR.Hubs.HubDispatcher.ProcessRequest(HostContext context) +174
Microsoft.AspNet.SignalR.Owin.CallHandler.Invoke(IDictionary`2 environment) +628
Microsoft.AspNet.SignalR.Owin.Handlers.HubDispatcherHandler.Invoke(IDictionary`2 environment) +222
Microsoft.Owin.Host.SystemWeb.OwinCallContext.Execute() +55
Microsoft.Owin.Host.SystemWeb.OwinHttpHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object extraData) +259
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
Microsoft.Owin.Host.SystemWeb.CallContextAsyncResult.End(IAsyncResult result) +110
Microsoft.Owin.Host.SystemWeb.OwinHttpHandler.EndProcessRequest(IAsyncResult result) +7
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8836913
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
これがコンソールログが提供したものです。
SignalR: Negotiating with '<root_url>/signalr/negotiate'. jquery.signalR-1.0.0-rc2.js:54
SignalR: Attempting to connect to SSE endpoint '<root_url>/signalr/connect?transport=serverSentEv…2fc32a4&connectionData=%5B%7B%22name%22%3A%22xmppservicehub%22%7D%5D&tid=7' jquery.signalR-1.0.0-rc2.js:54
SignalR: EventSource timed out trying to connect jquery.signalR-1.0.0-rc2.js:54
SignalR: EventSource readyState: 0 jquery.signalR-1.0.0-rc2.js:54
SignalR: EventSource calling close() jquery.signalR-1.0.0-rc2.js:54
SignalR: This browser supports SSE, skipping Forever Frame. jquery.signalR-1.0.0-rc2.js:54
SignalR: SignalR: Initializing long polling connection with server. jquery.signalR-1.0.0-rc2.js:54
SignalR: Attempting to connect to '<root_url>/signalr/connect?transport=longPolling&…fc32a4&connectionData=%5B%7B%22name%22%3A%22xmppservicehub%22%7D%5D&tid=10' using longPolling. jquery.signalR-1.0.0-rc2.js:54
SignalR: Longpolling connected jquery.signalR-1.0.0-rc2.js:54
SignalR: Attempting to connect to '<root_url>/signalr?transport=longPolling&connecti…%7CS%2C1%7CT%2C0%7CQ%2C0&groups=%5B%22XmppServiceHub.howtodemo%22%5D&tid=2' using longPolling. jquery.signalR-1.0.0-rc2.js:54
SignalR: Attempting to connect to '<root_url>/signalr?transport=longPolling&connecti…%7CR%2C0%7CS%2C1%7CT%2C0&groups=%5B%22XmppServiceHub.howtodemo%22%5D&tid=8' using longPolling. jquery.signalR-1.0.0-rc2.js:54
SignalR: Attempting to connect to '<root_url>/signalr?transport=longPolling&connecti…%7CR%2C0%7CS%2C1%7CT%2C0&groups=%5B%22XmppServiceHub.howtodemo%22%5D&tid=5' using longPolling. jquery.signalR-1.0.0-rc2.js:54
SignalR: An error occurred using longPolling. Status = error. <html>
<head>
<title>Protocol error: Unknown transport.</title>
ご参考までに:
- サーバー側は、ここで説明されている読み取り専用セッションを持つ SignalR ハブ です。
- Asp.Net MVC 4
- IIS 6 ウェブサーバー
手がかりを提供する方法がわかりません。これらの情報が十分でない場合は、どの情報をさらに提供する必要があるか教えてください。
編集
nuget (バージョン 1.0.0) の最新のライブラリで更新した後、次のエラーが発生しました (コンソール ログは同じで、ローカル マシンでは正常に動作していますが、リモート マシンでは正常に動作しています)。
[ObjectDisposedException]: The CancellationTokenSource has been disposed.
Server stack trace:
at System.Threading.CancellationTokenSource.ThrowIfDisposed()
at System.Threading.CancellationTokenRegistration.Dispose()
at Microsoft.AspNet.SignalR.Infrastructure.CancellationTokenExtensions.<>c__DisplayClass6`1.<SafeRegister>b__1()
at Microsoft.AspNet.SignalR.Infrastructure.DisposableAction.Dispose(Boolean disposing)
at Microsoft.AspNet.SignalR.Infrastructure.DisposableAction.Dispose()
at Microsoft.AspNet.SignalR.Transports.TransportHeartbeat.EndConnection(ConnectionMetadata metadata)
at Microsoft.AspNet.SignalR.Transports.TransportHeartbeat.AddConnection(ITrackingConnection connection)
at Microsoft.AspNet.SignalR.Transports.LongPollingTransport.ProcessRequest(ITransportConnection connection)
at Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(HostContext context)
at Microsoft.AspNet.SignalR.Hubs.HubDispatcher.ProcessRequest(HostContext context)
at Microsoft.AspNet.SignalR.Owin.CallHandler.Invoke(IDictionary`2 environment)
at Microsoft.AspNet.SignalR.Owin.Handlers.HubDispatcherHandler.Invoke(IDictionary`2 environment)
at Microsoft.Owin.Host.SystemWeb.OwinCallContext.Execute()
at Microsoft.Owin.Host.SystemWeb.OwinHttpHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object extraData)
Exception rethrown at [0]:
at Microsoft.Owin.Host.SystemWeb.Utils.<>c__DisplayClass1.<GetRethrowWithNoStackLossDelegate>b__0(Exception ex)
at Microsoft.Owin.Host.SystemWeb.Utils.RethrowWithOriginalStack(Exception ex)
at Microsoft.Owin.Host.SystemWeb.CallContextAsyncResult.End(IAsyncResult result)
at Microsoft.Owin.Host.SystemWeb.OwinHttpHandler.EndProcessRequest(IAsyncResult result)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
前もって感謝します