Solution
The reason is still unclear to me. But to solve it in very simple way, just declare all type of bindingFlags as follows.
using System.Reflection;
[ExtensionOf(classStr(SalesConfirmController))]
final class SalesConfirmController_XXX_Extension
{
Common XXX_ABC()
{
//var bindFlags = BindingFlags::Instance | BindingFlags::NonPublic;
var bindFlags = BindingFlags::Instance |
BindingFlags::NonPublic |
BindingFlags::Static |
BindingFlags::Public;
var field = this.GetType().GetField("custConfirmJour", bindFlags);
Common ret = field.GetValue(this);
return ret;
}
}
Until the next post!
References:
https://stackoverflow.com/questions/1040803/whats-wrong-with-this-reflection-code-getfields-is-returning-an-empty-array
https://msdn.microsoft.com/en-us/library/4ek9c21e(v=vs.110).aspx
No comments:
Post a Comment