Search Unity

Unity 2018.2.16f1, UWP, IL2CPP, HoloLens RS5 and Managed Debugging Problems.

Discussion in 'Windows Mixed Reality' started by mtaulty, Nov 27, 2018.

  1. mtaulty

    mtaulty

    Joined:
    Feb 1, 2018
    Posts:
    7
    Can someone help me troubleshoot C# script debugging on HoloLens please with IL2CPP? I've never had trouble with getting .NET debugging to work first time but my experience with IL2CPP has been patchy at best and it's currently broken for me.

    I'm building in Unity 2018.2.16f1. I have the 'Development Build', 'Script Debugging', 'Wait for Managed Debugger' options all set.

    I can build and deploy my code which targets SDK 10.0.17763.0. I'm running Visual Studio 15.9.2. My HoloLens is running 17763.134.x86fre.rs5_release_svc_prod1.181101-1643 and the app deploys to the device and runs up fine and displays the "you can now attach a managed debugger" dialog box.

    My device is on WiFi and my laptop is on a wired network that connects onto that WiFi (I have also tried my laptop on the same WiFi) and when I use the Debug->Attach Unity Debugger option in Visual Studio I see the HoloLens player as an option and I attach to it.

    Visual Studio goes a little busy and then the cursor resets itself and nothing seems to happen. There's no output in the Output window. The debugger doesn't seem to attach.

    Can someone please help me diagnose? I'm probably doing something obviously wrong or perhaps have just missed a step.

    I have looked into my firewall rules and (as far as I can tell) Visual Studio is allowed to accept incoming UDP and TCP connections.

    I have looked on the HoloLens for the UnityPlayer.log and I can find one in LocalAppData\Package\TempState\UnityPlayer.log but it seems to be 0 bytes in size.

    Thanks in advance!
     
  2. mtaulty

    mtaulty

    Joined:
    Feb 1, 2018
    Posts:
    7
    Please ignore - for other people who might come across this thread, I got this working.

    Essentially, my .appxmanifest inside of Unity contained the permissions for "Internet Client" and "Internet Client/Server" but when I checked inside of the generated Visual Studio project it only had "Internet Client" and so somewhere in the build process this had got out of sync between Unity and Visual Studio and that seemed to be causing the problem.

    As an aside, one of the helpful ways of trying to diagnose this was to try to make the connection from the Unity Profiler to the remote player on the HoloLens and to see that it was not able to connect either which pointed me to some kind of 'connection refused' scenario.

    I can now set breakpoints and debug on the HoloLens again. :)
     
  3. timke

    timke

    Unity Technologies

    Joined:
    Nov 30, 2017
    Posts:
    48
    I'm guessing you added the "Internet Client/Server" capability in Unity Editor after the VS solution had been generated. Correct?

    This is actually expected behavior: Unity does not update the .appxmanifest file after it's been created. We don't sync changes with the manifest because we don't want to blow away any changes you may have made directly to the VS project.

    This isn't pretty because some stuff gets updated in the VS Solution but not other things, but it's how it works right now. As a workaround, I think you can delete just the manifest file and Unity will regenerate it (using new settings/capabilities) the new time you build.

    BTW, if this isn't the case and the capability was missing from a freshly created VS solution, then please let us know; this would be a bug.
     
  4. mtaulty

    mtaulty

    Joined:
    Feb 1, 2018
    Posts:
    7
    Yes, I think I probably toyed with the manifest after the initial generation step and I should have known better because that has bitten me before but by that point I'd got bogged down in (wrongly) assuming that my manifest was set up the way it was meant to be.

    Thanks for responding though - appreciated.