"System.Reflection.Assembly" Error

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?

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…

        public static Assembly GetAssembly(this Type type)
        {
#if NETFX_CORE

            return type.GetTypeInfo().Assembly;
#else
            throw new NotImplementedException();
#endif
        }