Reflection under Unit Test

I get null object when I am trying to reflect class’s static method under unit test. But it ok under editor’s Play Mode. My platform settings: Android, IL2CPP and .Net4.xHere is my class:

namespace Core.Easing
{
public class EasingFunction
{
        public static float EaseNone(float t, float b, float c, float d)
        {
            return c * t / d + b;
        }
}
}

and here is my reflection method:

public Func<float, float, float, float, float> Build()
        {
            var namespaceName = "Core.Easing";
            var className = "EasingFunction";
            var easeMethodName = "EaseNone";

            var implType = Assembly.GetExecutingAssembly().GetType(namespaceName + "." + className);
            //var implType = Type.GetType(namespaceName + "." + className);//Also not working
            var implMethod = implType.GetMethod(easeMethodName, BindingFlags.Public | BindingFlags.Static);
            var res = Delegate.CreateDelegate(typeof(Func<float, float, float, float, float>), implMethod);
            return (Func<float, float, float, float, float>)res.Clone();
        }

So, Each class has its own asmdef file and these are included in the unit test. I looked at the constraints from Unity’s documentation but couldn’t find an answer.

One of reason I could think about is Unity stript out EasingFunction class when build for il2cpp. you could try to add Preserve attribute to EasingFunction.

Thank you for answer but not working. I added “[assembly: Preserve]” attribute on namespace level (Core.Easing) but it didn’t work. I got same error.

at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[ ],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) [0x00032] in <695d1cc93cca45069c528c15c9fdd749>:0