Hololens connect with pc Unet

Hello Everyone,

So I’m tasked recently by my boss to figure out how to make a hololens work.

So far I got some things to work with it but now the next step is to connect the hololens with a unity project that runs on the computer (while an app is running on the hololens aswell)
Basically i need to create a dashboard on the computer that can give orders to the hololens.

I have been googling a lot and looking at previous question and most about this topic sadly go unanswered.

Some people have suggested using mixed reality toolkit examples, but for me that only gives errors on loading in the assets let alone use it alongside other code i need so that doesn’t seem to be an option.

So far i have followed some unet tutorials and i got 2 unity apps working together with each other (on one computer) aswell as with 2 different computers. I basically used mostly the native unet where possible but i mostly made a custom hud so i can click in the hololens and connect to the host.

This code works on pc to pc and it also works when I use holographic emulation connected to the hololens, but when i build the app to the hololens it doenst connect to the server.
below ill post the scripts I use so far.

there is a button script I only need to use for the hololens itself because on the computer I can just use ui buttons linked to the right script.

This is the networkManager:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Networking;
using System;

public class NetworkManager_Custom : NetworkManager {

    public void StartupHost() {
        setPort();
        NetworkManager.singleton.StartHost();
    }

    public void JoinGame() {
        SetIpAddress();
        setPort();
        NetworkManager.singleton.StartClient();
    }

    private void SetIpAddress() {
        string Address = "192.168.10.120";
        NetworkManager.singleton.networkAddress = Address;
    }

    private void setPort() {
        NetworkManager.singleton.networkPort = 7777;
    }
}

and here is the code i use for the button to join the network:

using UnityEngine;
using UnityEngine.UI;

public class ButtonNetwork : MonoBehaviour
{
    NetworkManager_Custom manager;    
    public Text text;
    public MeshRenderer m_ButtonHighlight;

    private void Start() {
        manager = GameObject.Find("GameManager").GetComponent<NetworkManager_Custom>();
    }    
    public void OnGaze(bool hasGaze)
    {
        m_ButtonHighlight.enabled = hasGaze;
    }

    public void OnSelect()
    {
        text.text = "Pressed";
        manager.JoinGame();
    }
}

Any help would be very much appreciated!

Okay so it seems my code wasn’t at fault!

I was trying to connect to the unity editor project on my pc but Hololens can not connect to the editor but it can connect to a build version.