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.

"System.Reflection.Assembly" Error

Discussion in 'Windows' started by zeezeezee, Dec 14, 2013.

  1. zeezeezee

    zeezeezee

    Joined:
    Aug 6, 2013
    Posts:
    20
    Hey guys,

    I've upgraded my Unity from version 4.2.2 to 4.3.1 and I'm getting a weird compile error with my upgraded project.

    Error building Player: Exception: Error: method `System.Reflection.Assembly
    System.Reflection.Assembly::GetAssembly(System.Type)` doesn't exist in target framework. It is referenced from IFacebook.dll at Facebook.FBBuildVersionAttribute[] Facebook.FBBuildVersionAttribute::getAttributes(System.Type).



    My code used to compile with the older version of Unity.

    Is there a setting I forget to change or something?
     
  2. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,798
    Microsoft decided to get rid of a whole bunch of the .NET ways of doing things in WinRT, so you need to implement your own wrapper classes to handle these shortfalls.

    So you can do something like this...

    Code (csharp):
    1.         public static Assembly GetAssembly(this Type type)
    2.         {
    3. #if NETFX_CORE
    4.  
    5.             return type.GetTypeInfo().Assembly;
    6. #else
    7.             throw new NotImplementedException();
    8. #endif
    9.         }