Azure SignalR:HubException方法不存在 [英] Azure SignalR: HubException method does not exist

查看:391
本文介绍了Azure SignalR:HubException方法不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现我们收到此错误:

I am finding we receive this error:

Failed to invoke 'CreateChatRequest' due to an error on the server. HubException: Method does not exist.
at _this.callbacks.<computed> (chat.min.js:2060)
at HubConnection.processIncomingData (chat.min.js:2154)
at WebSocketTransport.HubConnection.connection.onreceive (chat.min.js:1881)
at WebSocket.webSocket.onmessage (chat.min.js:3922)

该方法确实存在.该代码可以正常工作,然后经过一段时间的测试,它会返回此代码,并且不会停止.

The method does exist. The code does work, then after a while of testing, it returns this and won't stop.

似乎暂时解决该问题的方法是重新启动Azure SigR服务,但是又回来了.在开发过程中以本地SigR为目标时,不会发生此问题.它只会在Azure SigR上发生.

What seems to temporarily fix the issue is restarting the Azure SigR service, but it comes back. This issue does not occur when targeting local SigR during development; it only happens against Azure SigR.

根据文档,当服务器上发生某些错误但未记录任何异常时,这似乎是一个全面的错误.我已经打开了详细的错误,但是并没有改变从服务器返回的错误.我还尝试捕获异常并发回HubException来查看发生了什么,但这也没有改变错误消息.

According to documentation, this seems to be a catchall error when something errors up on the server but, no exceptions are being logged. I've turned on detailed errors, but that didn't change the error coming back from the server. I've also tried catching the exception and sending back a HubException to see what is going on, but that didn't change the error message either.

TIA寻求帮助.

推荐答案

所以对我来说,答案是我签入了(以进行源代码控制)我的azure服务的连接字符串,因此其他开发人员也正在使用它,并且将其API服务的版本指向该Azure服务.因此,当我运行我的代码时,有时azure会使用新方法打入我的API服务,并且会起作用,有时它会打扰其他人的API服务,并会失败,因为他们的代码中没有新方法.

So the answer, for me, was that i'd checked in (to source control) my azure service's connection string, so other devs were also using this and pointing their versions of the API service at that azure service. So when i ran my code sometimes azure would hit my API service with the new method in and it would work, sometimes it would hit someone else's API service and so fail because their code didn't have the new method in.

这篇关于Azure SignalR:HubException方法不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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