/signalr/hubs 404 not found after update to MVC5

后端 未结 3 1787
心在旅途
心在旅途 2021-01-12 15:57

SignalR was working while project was ASP.NET MVC3. Now i upgraded it to MVC5 (not so easy to do, I must tell you).

Then I noticed that signalR was not working. I we

相关标签:
3条回答
  • 2021-01-12 16:21

    Like Milos said, clearing temp folder will probably fix the problem. I have created a script for doing this which I call powerreset.cmd which should be run As Administrator:

    @echo off
    @iisreset /stop
    @robocopy e:\empty "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files" /PURGE
    @robocopy e:\empty "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files" /PURGE
    @iisreset /start
    

    The e:\empty folder, which will be the source, and using purge with robocopy should then clear the temp files.

    0 讨论(0)
  • 2021-01-12 16:24

    The SignalR js versions are supposed to be the same, but can be different. As a side effect you will find that error in browser console.

    Check the version of SignalR library in Scripts folder and the one referenced in your view.

    • ~/Scripts/jquery.signalR-2.1.0.min.js (SignalR tutorial);
    • jquery.signalR-2.2.1.min.js is installed into scripts folder (nuget installation: install-package Microsoft.AspNet.SignalR).

    Sometimes the most evident things are left unnoticed.

    0 讨论(0)
  • 2021-01-12 16:32

    You need to install Microsoft.Owin.Host.SystemWeb package in the project

    Verify this link

    If package is not installed then install the following package from the Package Manager Console (PMC):

    Install-Package Microsoft.Owin.Host.SystemWeb

    UPDATE

    It purely says that, its not able to detect your startup class, here are few more findings.

    • I believe this key is no more exist in config file <add key="owin:AutomaticAppStartup" value="false" />
    • Your application might be cached in temp folder, try deleting temporary files for your application.(Go to run > %TEMP% > CTRL + A > Delete)

    This should definitely work, if it doesn't then try creating signalR in sample project.

    0 讨论(0)
提交回复
热议问题