Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Windows Store doesn't allow Reflection inside DLLs

Discussion in 'Editor & General Support' started by Demigiant, Aug 5, 2014.

  1. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Hi,

    the recent Unity 4.5.2p1 path re-implemented Type.GetFields or Type.GetProperties method from portable libraries (which were broken in v4.5.2), but they still don't work. You don't get errors while building anymore, but instead you get a
    Code (csharp):
    1.  
    2. MissingMethodException: Method not found '?'
    3.  
    when running your Windows Store build.

    The subsequent patches didn't fix this, and it's breaking some stuff pretty badly. Please fix it in the next patch.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,491
    Hi,

    can you file a bug report? The error message is really incomplete, so it's kind of hard to know what's wrong.
     
  3. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Hi,

    I know, it's the weirdest error message ever. I filed a bug report about GetField and GetProperty outside of a DLL (#621496) but I will try to file one which includes a DLL within tomorrow.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,491
  5. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
  6. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Thanks will definitely do that :) I don't have direct access to Windows Store (it's an issue with my HOTween plugin) but I'm going to ask a user to create a build for me.
     
  7. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    The good thing is that often the code still works, but unfortunately you have to compile the dll explicitly for those targets, due to the Windows RT changes which is only possible if you have Windows 8.x.
     
  8. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Everything is still working with Unity 4.5.1, but is broken with 4.5.2, so I hope I won't have to make a separate DLL from a Win 8 machine: it would be terrible :(

    P.S. still didn't manage to create the example. Will get on it later
     
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,491
    That shouldn't be needed. As long as you don't use unavailable methods/types, our tools "fix up" references to target correct framework.
     
  10. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    I had some trouble e.g. with thread pools, which were only moved to a different namespace. I don't know if it was changed meanwhile.
     
  11. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    I know my specific case is with GetField and GetProperty (which should become GetRuntimeField and GetRuntimeProperty after Unity "fixes them up" with its inner magic). I made the test project and sent it to a user to build it and test it to be sure it replicates the issue. Gonna submit the report as soon as I get a reply.
     
  12. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Just a quick update with apologies for not having the bug project ready yet. The interested users are in vacation and aren't able to test it for at least another week.