Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Can't attach HoloLens to Unity for remote debugging or profiling

Discussion in 'AR/VR (XR) Discussion' started by dixoncb, Feb 21, 2019.

  1. dixoncb

    dixoncb

    Joined:
    Jan 31, 2017
    Posts:
    4
    When running a Unity application on HoloLens, 'Attach Unity Debugger' in Visual Studio gives me only the Editor in the 'Select Unity Instance' dialog, with no players. As a result I can't do any script debugging of a running app, nor monitor its performance. Opening the Profiler window also fails to find the running player instance. This is something new for me - using .Net Scripting backend and Unity 2017.x.x, remote debugging always worked. This has started since I tried to move to the IL2CPP builds.

    I'm using the latest Visual Studio 2017 (15.9.7) with Unity 2018.3.6f1. The app is deploying correctly to my local address 192.168.1.106, which is on the same (wifi) subnet as my development PC. I have to enter this manually into the Properties/Debugging profile for the generated UWP project.

    My assumption is that there is a network issue somewhere preventing the HoloLens player from making contact with Unity, but that may not be the case. My NIC is multi-homed, as for most people doing HoloLens development, and includes IP ranges for VMs hosting the Microsoft emulators. Both the HoloLens and the PC are in developer mode. The deployment seems to run through each, and faults, including the IP address in the HoloLens subnet range (192.168.1.XXX) as follows:

    Connecting directly to Ip=192.168.1.XXX, port=34999 ...
    Socket: connect failed, error: Operation has failed with error 0x2733: A non-blocking socket operation could not be completed immediately.
    (0)
    (Filename: C:\buildslave\unity\build\Runtime/Network/Sockets.cpp Line: 415)

    Right now I can write and deploy HoloLens Unity apps, but I can't debug them. I've tried disabling firewall and antivirus with no effect. This was happening on a previous VS install, which I just unistalled. The new installation is fresh.

    My build settings are

    upload_2019-2-21_13-14-20.png

    My Player Settings are:

    upload_2019-2-21_13-16-20.png

    Capabilities:

    InternetClient
    InternetClientServer
    PrivateNetworkClientServer


    Supported Device Families:

    Holographic
     

    Attached Files:

  2. dixoncb

    dixoncb

    Joined:
    Jan 31, 2017
    Posts:
    4
    The Mixed Reality Toolkit (v2801.9.0) may be implicated here. I did a build without it, and I could see the remote player. Unfortunately I have to leave work right now so I can't do any more on this today, but I'll leave this here for the time being in case anyone else is seeing this.
     
  3. Deleted User

    Deleted User

    Guest

    I just wanted to write that I had the same problem (VS 2019), but while writing this it started to work again. Why I don't know. Here is what I did:
    - Uninstalled VS 2019 and installed VS 2017
    - Toggled Windows 10 firewall off, tested and turned back on (for some reason only then it triggered the dialogue for VS 2017's clearance)
    - rebooted FritzBox
    - Removed all pairings from Hololens and added the PC anew
    - Toggled the developer mode on the Hololens off and then back on

    I hope any of these help. I'd go for router first, Windows firewall second, Hololens settings third and Visual Studio fourth.
    My feeling is that in my case it was actually the router.