signalR 中与类型 System.Net.Http.WebRequestHandler 相关的奇怪异常

Weired exception in signalR related to type System.Net.Http.WebRequestHandler

已成功创建服务器 signalR 应用程序,我可以通过导航到 http://localhost:11914/signalr/hubs 查看创建的 JavaScript 代码模板。

客户端应用程序是一个 .NET 4.6.2 web api,由 Visual Studio 2017 最新 RC 使用最近的模板创建。当我执行下面的代码时:

    var hubConnection = new HubConnection("http://localhost:11914");
    var hubProxy = hubConnection.CreateHubProxy("cache");
    hubProxy.On<CachedObjectInfo>("sendUpdateNotification", cachedObject => RefreshMemory(cachedObject));
    await hubConnection.Start();

我在点击 await hubConnection.Start();

时收到以下异常
type: 'System.Net.Http.WebRequestHandler'. Derived types must either match the security accessibility of the base type or be less accessible.'

客户端 singalR 应用程序利用 Microsoft.AspNet.SignalR.Client 版本 2.2.1 包。

我不知道为什么我会收到这样的异常,而且我找不到任何解决方案。根本原因是什么以及如何缓解它?

我认为这是 System.Net.Http 软件包版本的问题。更具体地说,如果您为您 运行 的项目安装了 v4.1.1 - v4.3.0,那么当您以 .NET 4.6.1 或 4.6.2 为目标时,您将 运行 遇到此问题。有关详细信息,请参阅 this thread。为了解决这个问题,他们发布了一个新的软件包,System.Net.Http 4.3.1,应该可以消除错误。