How to create a asnetcore.signalr connection using unity and the microsoft hololens
Hey, I recently started using unity to create a user interface application for the Microsoft HoloLens. I use Unity 2019.4.0f1. As I want to use unity as a frontend for my application, I wanted to use signalr to enable communication between a server application running on my machine and the unity frontend. The minimal code for the unity signalrclient is as below:
public class SignalRConnection : MonoBehaviour { static HubConnection connection; void Start() { Application.runInBackground = true; UnityEngine.Debug.Log("Build Signalr Hub."); var connection = new HubConnectionBuilder() .WithUrl("http://PC-Name:5003/ARVista") .Build(); connection.StartAsync(); } }
Now the funny thing is, if I start the application from the editor the connection is created. However after building a UWP app with Il2Cpp no connection is created. I tested the uwp uild using a Microsoft Hololens and the HoloLens1&2 Emulator. At the player capabiities i checked InternetClient, InterneClientServer, PrivateNetworkClientServer and I added a link.xml containing Newtonsoft.Json and Microsoft.AspNetCore.SignalR.Client.
I think I miss one setting somewhere. Any idea what I can do to solve or at least analyze the problem?
Thank you very much.
Answer by Skoerven · Jul 29, 2021 at 06:41 AM
Did you find a solution I have the same problem? It works perfectly fine in Unity but when I try it out on the Hololens2 I get an exception. I hope you can read the text on the img (only allowed to be 524.3KB huge )
First img is what it looks like in Unity and it works perfectly fine. Second img is from the Hololens2
Your answer

Follow this Question
Related Questions
Tizen ClI Configuration does not exits? 0 Answers
SyncVar works not always 0 Answers
[UNET] How do I allow clients to move a GameObject that exists on the server? 0 Answers
Spawning Network Objects from the client | Unity Netcode For Gameobjects 0 Answers
ClientRpc Function not being carried out on clients in Unity3d c# 0 Answers