托管到IIS时,Blazor客户端发信号器无法正常工作 [英] Blazor Client Side Signalr not working when Hosting to IIS

查看:110
本文介绍了托管到IIS时,Blazor客户端发信号器无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人能指出我正确的方向?

Is there any one who can point me in the right direction?

将我的Blazor客户端应用程序托管到IIS时,信号器无法正常工作. 在带有IIS的visual studio中,它可以按预期工作. 我确实设置了IIS,并按照Microsoft文档中的指示部署了应用程序.

When hosting my Blazor Client Side application to IIS the signalr is not working. In visual studio with IIS express it work as expected. I did setup IIS and deployed the application as indicated in the Microsoft documents.

没有控制台错误,并且在IIS中托管时,集线器返回状态代码200.

There is no console errors and the hub returns status code 200 when hosting in IIS.

提前谢谢

推荐答案

IIS默认情况下未启用Websocket支持.它是在IIS 8中引入的,必须从Windows的可选功能中启用:

Websocket support is not enabled by default on IIS. It was introduced in IIS 8, and has to be enabled from windows' optional features: https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-8/iis-80-websocket-protocol-support

可选功能-> IIS-> WWW服务-> App Dev功能-> Websocket协议

Optional features -> IIS -> WWW services -> App Dev Features -> Websocket protocol

免责声明:我是在问了一个关于自己的问题后才发现的,因此我从那里复制了我的答案: https://stackoverflow. com/a/61411666/4364057

Disclaimer: I found this after asking a question about this myself, so I copied my answer from there: https://stackoverflow.com/a/61411666/4364057

这篇关于托管到IIS时,Blazor客户端发信号器无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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