0

Is it possible to listen for the events from Serverless Azure SignalR service from .NetFramework 4.7.1 (Unity) app?

I have implemented the solution which works with javascript client and .net Core 3.1 client, but cannot get the .NetFramework 4.7.1 (Unity app) client to work. I am trying to use the same libraries as with the .Net Core 3.1 client. That is: "Microsoft.AspNetCore.SignalR.Client" version 5.0.2 with its dependencies. But I am getting different kinds of errors from the libraries.

When I am missing dependencies such as System.Text.Json I get an error

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

When I add the dependency the error is:

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)

Is it supposed to work like that, or am I banging my head to the stone. I am not familiar with the C# library / runtime stuff.

  • Normally, we use Azure SignalR Service with Serverless Service Mode only if we are using it through Azure Functions binding or REST API. – Fei Han Jan 15 '21 at 03:34
  • Solution: Since unity does not support nuget, I created a clean .netframework 4.7.1 project using microsoft.aspnetcore.signalr.client 3.1.11 libraries. Also had to put 'true' to the project file. After building that project, I copied all nuget libraries from that new temp project to my Unity project. And then all the libraries worked in Unity without any errors from library conflicts. – user2215093 Jan 15 '21 at 09:10

0 Answers0