SignalR 2.2返回IIS 8.5上找不到404 [英] SignalR 2.2 returns 404 Not Found on IIS 8.5

查看:109
本文介绍了SignalR 2.2返回IIS 8.5上找不到404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在开发服务器(Windows 2012 Server和IIS8.5)上发布了Web-Api2.

I've publish my Web-Api2 on a development server (Windows 2012 Server and IIS8.5).

我添加了Websockets Protocol角色,并且还完成了

I've added the Websockets Protocol role, and also went through the steps in this answer to make sure everything is set up on my side. The app is running under `Default Web Site'.

但是,我仍然遇到此错误:

However, I'm still getting this error:

Microsoft.AspNet.SignalR.Client.HttpClientException: StatusCode: 404, 
ReasonPhrase: 'Not Found', Version: 1.1, Content:
System.Net.Http.StreamContent, Headers:
{
   Date: Fri, 15 Jul 2016 09:18:54 GMT
   Server: Microsoft-IIS/8.5
   X-Powered-By: ASP.NET
   Content-Length: 1285
   Content-Type: text/html
}
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__DisplayClass42.<RunTask>b__41(Task`1 t)

我是否需要添加其他服务器角色或进一步配置IIS?

Do I need to add other server roles or configure IIS further?

推荐答案

问题出在应用程序的客户端,如此处Microsoft.AspNet.SignalR.Client.HttpClientException

The problem was on the client side of the application as shown from here Microsoft.AspNet.SignalR.Client.HttpClientException

状态代码为404 Not Found.

问题是从本地主机部署到Windows 2012服务器中运行的实际IIS后,传递给集线器连接的URL错误.修复网址后,客户端即可正常运行.

The problem was a wrong url passed to the hub connection after deploying from localhost to an actual IIS running in Windows 2012 server. Once the url was fixed, the client runs without problems.

这篇关于SignalR 2.2返回IIS 8.5上找不到404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆