SignalR 2.0错误/ signalr /集线器404(未找到)使用IIS时 [英] SignalR 2.0 error /signalr/hubs 404 (Not Found) when using IIS

查看:4366
本文介绍了SignalR 2.0错误/ signalr /集线器404(未找到)使用IIS时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在与SignalR 2.0 EPiServer 7.5(一个MVC4框架)的一些问题。我得到的是一个404错误

I'm having some issues with SignalR 2.0 in EPiServer 7.5 (a MVC4 framework). All I get is a 404 error

http://web.com/signalr/hubs 404(未找到)

我是Windows 2012 R2服务器上托管的一切。另外值得一提的是,,但不是在IIS 8.5上运行从Visual Studio在IIS防爆preSS一切,当该解决方案适用

I'm hosting everything on a Windows 2012 R2 Server. Also noteworthy is that the solution works when running everything in IIS Express from Visual Studio but not in IIS 8.5.

我到目前为止已经做的是添加SingalR引用。

What I've done so far is to add the SingalR references.


  • Microsoft.AspNet.SignalR.Client,2.0.0.0

  • Microsoft.AspNet.SignalR.Core,2.0.0.0

  • Microsoft.AspNet.SignalR.System.Web,2.0.0.0

  • Microsoft.OWin,2.1.0.0

  • Microsoft.OWin.Host.SystemWeb,2.1.0.0

  • Microsoft.Owin.Security,2.0.0.0

  • Owin,1.0.0.0

Startup.cs

启动是intitialized在应用程序启动,这样似乎工作。

The startup is intitialized on application start so that seems to work.

[assembly: OwinStartup(typeof(Web.Startup))]
namespace Web
{
    public class Startup
    {
        #region Local variables

        private static readonly ILog Logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        #endregion

        #region Methods

        /// <summary>
        /// Configure SignalR
        /// </summary>
        /// <param name="app"></param>
        public void Configuration(IAppBuilder app)
        {
            try
            {
                Logger.MethodCallEntry();

                // Any connection or hub wire up and configuration should go here
                //app.MapSignalR(); // Doesn't work either
                var hubConfiguration = new HubConfiguration
                {
                    EnableDetailedErrors = true,
                    EnableJavaScriptProxies = false
                };

                app.MapSignalR("/signalr", hubConfiguration);
            }
            catch (Exception ex)
            {
                Logger.Error("Failed to initialize or map SignalR", ex);
            }
            finally
            {
                Logger.MethodCallExit();
            }
        }

        #endregion
    }
}

脚本包含

<script src="/Static/Frameworks/Scripts/jquery-1.10.2.js"></script>
<script src="/Static/Frameworks/Scripts/knockout-3.0.0.js"></script>
<script src="/Static/Frameworks/Scripts/modernizr.2.7.0.js"></script>
<script src="/Static/Frameworks/Scripts/jquery.signalR-2.0.1.js"></script>
<!-- also tried path ~/signalr/hubs -->
<script src="/signalr/hubs"></script>

这是不是从1.x的SignalR更新的解决方案!

This is not a solution updated from 1.x SignalR!

推荐答案

错误是完全相同的在这个岗位
<一href=\"http://blogs.msdn.com/b/praburaj/archive/2013/12/02/owin-startup-class-not-detected.aspx\">http://blogs.msdn.com/b/praburaj/archive/2013/12/02/owin-startup-class-not-detected.aspx

The error was the exact same as in this post http://blogs.msdn.com/b/praburaj/archive/2013/12/02/owin-startup-class-not-detected.aspx

解决方案是完全空的asp.net缓存

The solution was to totally empty the asp.net cache

运行此

net stop w3svc
Remove-Item -Path "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\*" -Force -Recurse
Remove-Item -Path "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\*" -Force -Recurse
net start w3svc

这篇关于SignalR 2.0错误/ signalr /集线器404(未找到)使用IIS时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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