首页 > 解决方案 > 无服务器 Azure SignalR 服务和 .NetFramework 4.7.1(Unity 应用)

问题描述

是否可以从 .NetFramework 4.7.1 (Unity) 应用程序中侦听来自无服务器 Azure SignalR 服务的事件?

我已经实现了适用于 javascript 客户端和 .net Core 3.1 客户端的解决方案,但无法让 .NetFramework 4.7.1(Unity 应用程序)客户端工作。我正在尝试使用与 .Net Core 3.1 客户端相同的库。即:“Microsoft.AspNetCore.SignalR.Client”版本 5.0.2 及其依赖项。但是我从库中得到了不同类型的错误。

当我缺少诸如 System.Text.Json 之类的依赖项时,我收到一个错误

Unloading broken assembly Assets/Plugins/Microsoft.AspNetCore.SignalR.Common.dll, this assembly can cause crashes in the runtime

当我添加依赖项时,错误是:

TypeLoadException: Could not resolve type with token 01000066 (from typeref, class/assembly System.Text.Json.Serialization.JsonIgnoreCondition, System.Text.Json, Version=5.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
Microsoft.AspNetCore.SignalR.JsonHubProtocolOptions..ctor () (at <c72a5d3426db4d1989e41390e5494e1a>:0)

它应该像那样工作,还是我把头撞在石头上。我不熟悉 C# 库/运行时的东西。

标签: signalr.clientasp.net-core-signalrazure-signalr

解决方案


推荐阅读