Unable to register routes in SignalR 2.0.0

后端 未结 5 530
旧时难觅i
旧时难觅i 2021-01-12 09:47

I decided to move to the latest version of signalr but i facing a few issues. First of all the way to register routes has entirely changed; so i tried to do it the way that

相关标签:
5条回答
  • 2021-01-12 09:57

    I was able to get the 2.0 beta working by

    • Removing all references to the older version of SignalR, ie nuget uninstall of the library and double checking /bin

    • Installed SignalR 2.0.0-beta2 via Package Manager Console Install-Package Microsoft.AspNet.SignalR -Pre

    • Following the steps in the 1.x to 2.0 migration outlined in the ops link

    • And most importantly changing the project config to use Local IIS Web server instead of Visual Studio Developer Server (Cassini).

    More info in the question/answer I posted here

    0 讨论(0)
  • 2021-01-12 10:03

    Solution !

    <appSettings>
        <add key="owin:AppStartup" value="MyNameSpace.Startup, MyNameSpace" />
        <add key="owin:AutomaticAppStartup" value="true" />
    </appSettings>
    
    <system.web>
    <httpHandlers>
      <add verb="*" path="*" type="Microsoft.Owin.Host.SystemWeb.OwinHttpHandler, Microsoft.Owin.Host.SystemWeb"/>
    </httpHandlers>
    </system.web>
    
    <system.webServer>
    <handlers>
      <add name="Owin" verb="*" path="*" type="Microsoft.Owin.Host.SystemWeb.OwinHttpHandler, Microsoft.Owin.Host.SystemWeb"/>
    </handlers>
    </system.webServer>
    
    0 讨论(0)
  • 2021-01-12 10:15

    For me, the answer was that this DLL was missing:

    Microsoft.Owin.Host.SystemWeb.dll
    

    It was omitted by my build process. It seems that it needs to be present in the bin folder of an Asp.Net site for the Configuration method to get called.

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

    By default it will search for a file called Startup; so the only thing i had to do was to create a Startup class under the Assembly-name.Startup namespace.

    The namespace should follow the above pattern to make the it possible to find the startup class

    0 讨论(0)
  • 2021-01-12 10:18

    Is this a website? If this is a website the assembly for the website is getting generated dynamically so you cannot figure out the fully qualified name of your startup class like this. Instead try adding an assembly level attribute in your code like this and see if your Startup.Configuration is invoked.

    [assembly : OwinStartup(typeof(Startup))]

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