SignalR version compatability (StatusCode: 405 'Method Not Allowed')
Asked Answered
A

2

16

I'm having issues with a SignalR project I'm currently working on. I'm trying to build a server using .Net Core, and a client using traditional .Net (framework 4.6.1). However the server and client don't seem to be compatible.

The last issue I've run into is a StatusCode: 405, ReasonPhrase: 'Method Not Allowed'. I found an answer on GitHub that states that there are many breaking changes between versions.

Looking at the NuGet package versions available, I get even more confused. for the .Net Core server I'm using 1.0.0-preview1-final. There's also a 1.0.0-alpha2-final available, but I have no clue if 'alpha' is newer or older than 'preview'.

On the client side I was using version 2.2.2, and there's a whole range of versions to choose from, I tried the oldest and latest, but both versions give me the same "method not allowed" error.

The error is on the client side, on the server side, my breakpoints are not even hit, so it could be an Owin/iis issue as well.

Is there any chart out there that can map SignalR clients and server version compatability? I guess that would be a great step moving forward.

Agneta answered 7/3, 2018 at 12:54 Comment(0)
K
12

You can't mix the .NET Core 1.x with the older client (1.x or 2.x). You will need to decide which is the best option for you but you need to implement the same compatible version across CLIENT and SERVER.

Check the link for more details but essentially:

What’s Changed?

We added a number of new features to SignalR for ASP.NET Core but we also decided to remove support for some of the existing features or change how they work. One of the consequences of this is that SignalR for ASP.NET Core is not compatible with previous versions of SignalR. This means that you cannot use the old server with the new clients or the old clients with the new server.

Kinesics answered 7/3, 2018 at 13:32 Comment(7)
What that document doesn't say is what versions are compatible. The latest NPM package (npmjs.com/package/@aspnet/signalr-client) says '1.0.0-alpha2-final is the latest of 2 releases' which was published 5 months ago, whereas the aspnetcore version (nuget.org/packages/Microsoft.AspNetCore.SignalR) is '1.0.0-preview1-final' which was published 9 days ago.Vaporific
I think their GitHub page (github.com/aspnet/SignalR) clarifies that as it states under Packages: NOTE: Previous previews of the SignalR client library for JavaScript were named @aspnet/signalr-client. This has been deprecated as of Preview 1.Kinesics
Argh! I should have asked before I started... Thanks.Agneta
I know questions get locked for too many "thank you"s... but too bad!! THANK YOU!Annal
Why didn't they call the .Net Core version 3.0 instead of starting at 1.0 again. I'm still disappointed. This means we cannot take advantage of .Net Core for a new service because our existing application (that would become the client) is not a .Net Core app. Is anyone working on porting one either way or do I definitively have to make the choice between dropping either SignalR or .Net Core for the new service?Agneta
As I understand it, the .Net Core version is a rewrite not just a feature upgrade. As it is still "Preview" and not a full release I am holding at .Net 4.6/7. That also would complicate, IMHO, anyone making some intermediary to handle calls between the two different versions.Kinesics
The naming convention/scheme/whatever you want to call it, has proper tripped me up this week. I've wasted 2 days trying to track down a random bug; which turned out to be - mismatched versions. Horrendous form Microsoft..Inlay
P
0

Check the services are injected, possible some is not yet injected in the service container.

When add the signalR service you can enable detailed errors to know what is happening.

    builder.Services.AddSignalR(o=> 
    {
        o.EnableDetailedErrors = true;
    });
Pastelki answered 23/7, 2022 at 23:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.