Search Unity

MethodInfo.CreateDelegate (UWP) vs. Delegate.CreateDelegate (.NET 3.5) issue when deploying to HoloL

Discussion in 'VR' started by trzy, Nov 5, 2017.

  1. trzy

    trzy

    Joined:
    Jul 2, 2016
    Posts:
    128
    Hi,

    My program uses Delegate.CreateDelegate() but I discovered when trying to build a Windows Store app that this no longer exists. Thank you MS, for that :) Instead, it has been moved to MethodInfo.CreateDelegate(). No problem, I've substituted this and used #if NETFX_CORE to use it and otherwise fallback on Delegate.CreateDelegate() when testing in the Unity Editor.

    The problem is, this still doesn't seem to work when deployed on the actual device and I have no idea why! I unfortunately can't debug using the HoloLens emulator (my current machine runs Windows 10 Home) and I still don't know what the best way to debug a HoloLens app remotely is (therefore, I don't see exactly where it's failing). However:

    1. The app boots up and runs.
    2. MonoBehaviours that call this code fail (they obviously stop updating, but the app continues to run).

    This is the same behavior I observer when I tried deploying with Delegate.CreateDelegate() using an external DLL. So I'm assuming that the appropriate dependency is not being pulled in (System.Reflection.dll maybe?).

    I have no idea how to debug this further. I'm not using .NET 4.x or anything like that and prefer to stick with .NET 3.5. I'm using Unity 2017.1.0f3 with MSVC 2015.

    Any ideas? Surely there is a way to get CreateDelegate() to work...

    Thank you,

    Bart
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Debugging on remote device works exact same way as debugging on local machine, except that in VS deployment settings you need to set deployment target to "Remote Machine".