简体   繁体   English

移至IIS7服务器后出现Signalr 404错误

[英]Signalr 404 error after moving to iis7 server

I have a signalr service that is working fine on my development environment when hosted in IIS 8. 当托管在IIS 8中时,我有一个信号器服务在我的开发环境上运行良好。

When the service is moved to our QA server using IIS 7.5, attempting to connect to my hub results in this error: 使用IIS 7.5将服务移至我们的质量检查服务器时,尝试连接到我的集线器会导致此错误:

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)<---

My Startup class 我的创业班

[assembly: OwinStartup(typeof(SignalRStartup))]

  public class SignalRStartup
  {
    public void Configuration(IAppBuilder app)
    {
      app.MapSignalR("/restricted/signalr", new HubConfiguration());
    }
  }

And attempting to start a connection in the c# client 并尝试在C#客户端中启动连接

HubConnection foo = new HubConnection("http://localhost/ccwebdev/restricted");
foo.Start().Wait();

The QA server is running windows server 2008 r2 SP1, so it should have support for extensionless urls. 质量检查服务器正在运行Windows Server 2008 R2 SP1,因此它应支持无扩展名的URL。

I also tried adding this to my web.config <modules runAllManagedModulesForAllRequests="true"/> 我还尝试将其添加到我的web.config <modules runAllManagedModulesForAllRequests="true"/>

The app pools are in integrated mode, not classic mode 应用程序池处于集成模式,而不是经典模式

I have read many other similar SO posts and the troubleshooting guide for 404's here: http://www.asp.net/signalr/overview/signalr-20/troubleshooting-and-debugging/troubleshooting#other , but with no luck. 我在这里阅读了许多其他类似的SO文章和404的故障排除指南: http//www.asp.net/signalr/overview/signalr-20/troubleshooting-and-debugging/troubleshooting#other ,但是没有运气。

Can anyone provide any other troubleshooting steps I can try? 谁能提供我可以尝试的其他任何疑难解答步骤?


EDIT 编辑

changing my map call to app.MapSignalR("/restricted", new HubConfiguration()); 将地图调用更改为app.MapSignalR("/restricted", new HubConfiguration()); causes an exception to be thrown on service startup 导致在服务启动时引发异常

[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

Did you try to manually patch the server for extensionless URLs? 您是否尝试手动修补服务器以获取无扩展名的URL? I'm not sure if server 2008 R2 SP1 includes that patch- you can give it a try and see: 我不确定服务器2008 R2 SP1是否包含该修补程序-您可以尝试一下:

http://support.microsoft.com/kb/980368 http://support.microsoft.com/kb/980368

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM