SignalR net45 在特定用户/机器组合上给出 401 Unauthorized [英] SignalR net45 gives 401 Unauthorized on specific user/machine combinations

查看:38
本文介绍了SignalR net45 在特定用户/机器组合上给出 401 Unauthorized的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们最近将 WPF 应用程序及其所有 NuGet 依赖项更新到 .NET 4.5.2,并发现一些用户收到来自 SignalR 的 HTTP 401 Unauthorized 错误.正在通过 PrincipalUserIdProvider 使用 Windows 身份验证.

We recently updated a WPF app and all of its NuGet dependencies to .NET 4.5.2 and find that some users are receiving HTTP 401 Unauthorized errors from SignalR. The is using Windows Authentication via PrincipalUserIdProvider.

在连接到 SignalR 后,我在第一次向 SignalR POST 时收到 401 错误,但这是一个奇怪问题的原因有很多:

I receive the 401 error on the first POST to SignalR after connecting to SignalR but here are many reasons why this is a strange issue:

  • 它在我运行 Fiddler 时有效
  • 当我在 Citrix 上运行该应用程序时它可以工作
  • 当我在其他人的 PC 上使用 Run As 运行应用程序时,它可以工作
  • 当我登录到其他人的 PC 时它可以工作
  • 当我在 .NET 4.0 上运行旧版本的客户端(仍然连接到同一台服务器)时,它可以工作
  • 它适用于 QA(但不是所有的东西?)
  • 当其他人使用我的电脑运行应用程序时,它会起作用

此问题仅发生在一小部分用户/机器组合中,但对于这些设置,401 发生的概率为 100%.发生在 Win7 和 Win8.1 客户端上.服务器没有安装 websockets.

The issue only occurs for a small fraction of user/machine combinations, but for those setups the 401 occurs 100% of the time. Occurs on both a Win7 and Win8.1 client. Server does not have websockets installed.

对可能的问题有什么建议吗?

Any suggestions on what could possibly be the issue?

推荐答案

我不知道为什么,但引用 SignalR 客户端 dll 的 net40 副本而不是 net45 副本可以解决问题.

I have no idea why, but referencing the net40 copy of the SignalR client dll instead of the net45 copy resolves the issue.

我删除了对 Microsoft.AspNet.SignalR.Client.dll 的引用,并使用 NuGet 包文件夹中的 net40 dll 读取了引用:Microsoft.AspNet.SignalR.Client.2.2.0lib et40Microsoft.AspNet.SignalR.Client.dll

I deleted the reference to Microsoft.AspNet.SignalR.Client.dll and readded the reference using the net40 dll in my NuGet packages folder: Microsoft.AspNet.SignalR.Client.2.2.0lib et40Microsoft.AspNet.SignalR.Client.dll

这篇关于SignalR net45 在特定用户/机器组合上给出 401 Unauthorized的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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