我有一个信号器服务,在IIS 8中托管时,在我的开发环境中运行良好。
当使用IIS 7.5将服务移动到我们的QA服务器时,尝试连接到我的集线器会导致此错误:
System.AggregateException: One or more errors occurred. ---> Microsoft.AspNet.SignalR.Client.HttpClientException: StatusCode: 404, ReasonPhrase: 'Not Found', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Cache-Control: private
Date: Thu, 06 Mar 2014 20:09:35 GMT
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Content-Length: 5307
Content-Type: text/html; charset=utf-8
}
at Microsoft.AspNet.SignalR.Client.Http.DefaultHttpClient.<>c__DisplayClass2.<Get>b__1(HttpResponseMessage responseMessage)
at Microsoft.AspNet.SignalR.TaskAsyncHelper.<>c__DisplayClass19`2.<Then>b__17(Task`1 t)
at Microsoft.AspNet.SignalR.TaskAsyncHelper.TaskRunners`2.<>c__DisplayClass3a.<RunTask>b__39(Task`1 t)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at ConsoleApplication2.Program.Main(String[] args)
---> (Inner Exception #0) Microsoft.AspNet.SignalR.Client.HttpClientException: StatusCode: 404, ReasonPhrase: 'Not Found', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Cache-Control: private
Date: Thu, 06 Mar 2014 20:09:35 GMT
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Content-Length: 5307
Content-Type: text/html; charset=utf-8
}
at Microsoft.AspNet.SignalR.Client.Http.DefaultHttpClient.<>c__DisplayClass2.<Get>b__1(HttpResponseMessage responseMessage)
at Microsoft.AspNet.SignalR.TaskAsyncHelper.<>c__DisplayClass19`2.<Then>b__17(Task`1 t)
at Microsoft.AspNet.SignalR.TaskAsyncHelper.TaskRunners`2.<>c__DisplayClass3a.<RunTask>b__39(Task`1 t)<---
我的启动课程
[assembly: OwinStartup(typeof(SignalRStartup))]
public class SignalRStartup
{
public void Configuration(IAppBuilder app)
{
app.MapSignalR("/restricted/signalr", new HubConfiguration());
}
}
尝试在c#客户端
中启动连接HubConnection foo = new HubConnection("http://localhost/ccwebdev/restricted");
foo.Start().Wait();
QA服务器正在运行Windows Server 2008 r2 SP1,所以它应该支持无扩展名网址。
我也尝试将此添加到我的web.config中
<modules runAllManagedModulesForAllRequests="true"/>
应用程序池处于集成模式,而不是经典模式
我在这里阅读了许多其他类似的SO帖子和404的故障排除指南:http://www.asp.net/signalr/overview/signalr-20/troubleshooting-and-debugging/troubleshooting#other, 但没有运气。
任何人都可以提供我可以尝试的其他任何疑难解答步骤吗?
修改
将我的地图调用更改为app.MapSignalR("/restricted", new HubConfiguration());
导致在服务启动时抛出异常
[InvalidOperationException: Protocol error: Unknown transport.]
Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(HostContext context) +384
Microsoft.AspNet.SignalR.Hubs.HubDispatcher.ProcessRequest(HostContext context) +502
Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(IDictionary`2 environment) +328
Microsoft.Owin.Mapping.<Invoke>d__0.MoveNext() +611
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar) +208
System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +434
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
答案 0 :(得分:0)
您是否尝试手动修补服务器以获取无扩展名的网址?我不确定服务器2008 R2 SP1是否包含该补丁 - 您可以尝试一下,看看: