SignalR版本兼容性(状态代码:405“不允许使用方法") [英] SignalR version compatability (StatusCode: 405 'Method Not Allowed')

查看:838
本文介绍了SignalR版本兼容性(状态代码:405“不允许使用方法")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理的SignalR项目有问题.我正在尝试使用.Net Core构建服务器,并使用传统.Net(框架4.6.1)构建客户端.但是服务器和客户端似乎不兼容.

我遇到的最后一个问题是StatusCode:405,ReasonPhrase:不允许使用方法".我在 GitHub 上找到了一个答案,指出版本之间存在许多重大更改.

看看可用的NuGet软件包版本,我感到更加困惑.对于.Net Core服务器,我正在使用1.0.0-preview1-final.还有一个1.0.0-alpha2-final,但是我不知道'alpha'是比'preview'更新或更旧的.

在客户端,我使用的是2.2.2版本,并且有很多版本可供选择,我尝试了最旧和最新的版本,但是两个版本都给我同样的不允许使用方法"错误.

错误发生在客户端,而在服务器端,我的断点甚至没有命中,因此它也可能是Owin/iis问题.

是否有可以映射SignalR客户端和服务器版本兼容性的图表?我想这将是向前迈出的重要一步.

解决方案

您不能将.NET Core 1.x与较旧的客户端(1.x或2.x)混合使用.您将需要确定哪个是最合适的选择,但是您需要在CLIENT和SERVER之间实现相同的兼容版本.

检查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.

解决方案

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.

这篇关于SignalR版本兼容性(状态代码:405“不允许使用方法")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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