We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
热更代码中含有静态构造生产CLR绑定会报错
static ListController() { var type = typeof(AA); var flag = BindingFlags.NonPublic | BindingFlags.Instance; fileInfo = type.GetField("mItemPrefabDataList", flag); itemDict = type.GetField("mItemPoolDict", flag); itemList = type.GetField("mItemPoolList", flag); recycleAllItem = type.GetMethod("RecycleAllItem", flag); adjustAnchorInfo = type.GetMethod("AdjustAnchor", flag); adjustPivotInfo = type.GetMethod("AdjustPivot", flag); }
ArgumentNullException: Value cannot be null. Parameter name: types System.Type.GetMethod (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) (at :0) ILRuntime.Reflection.ILRuntimeWrapperType.GetMethodImpl (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) (at Assets/Scripts/ILRT/ILRuntime/Reflection/ILRuntimeWrapperType.cs:117) System.Type.GetMethod (System.String name, System.Reflection.BindingFlags bindingAttr) (at :0) System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at :0) ILRuntime.CLR.Method.CLRMethod.Invoke (ILRuntime.Runtime.Intepreter.ILIntepreter intepreter, ILRuntime.Runtime.Stack.StackObject* esp, System.Collections.Generic.IList`1[T] mStack, System.Boolean isNewObj) (at Assets/Scripts/ILRT/ILRuntime/CLR/Method/CLRMethod.cs:316) ILRuntime.Runtime.Intepreter.ILIntepreter.Execute (ILRuntime.CLR.Method.ILMethod method, ILRuntime.Runtime.Stack.StackObject* esp, System.Boolean& unhandledException) (at Assets/Scripts/ILRT/ILRuntime/Runtime/Intepreter/ILIntepreter.cs:1797) Rethrow as ILRuntimeException: Exception has been thrown by the target of an invocation. IL_0049: callvirt System.Reflection.MethodInfo System.Type::GetMethod(System.String,System.Reflection.BindingFlags) Common.ListController..cctor()
The text was updated successfully, but these errors were encountered:
是啊,我也遇到了类似情况:
似乎是分析过程中,静态构造代码会被实际运行,如果某个静态字段的初值依赖于实际运行结果,那肯定在分析模式下会出错了。
Sorry, something went wrong.
Fixed #263 #254
f6707c9
No branches or pull requests
热更代码中含有静态构造生产CLR绑定会报错
static ListController() { var type = typeof(AA); var flag = BindingFlags.NonPublic | BindingFlags.Instance; fileInfo = type.GetField("mItemPrefabDataList", flag); itemDict = type.GetField("mItemPoolDict", flag); itemList = type.GetField("mItemPoolList", flag); recycleAllItem = type.GetMethod("RecycleAllItem", flag); adjustAnchorInfo = type.GetMethod("AdjustAnchor", flag); adjustPivotInfo = type.GetMethod("AdjustPivot", flag); }
ArgumentNullException: Value cannot be null.
Parameter name: types
System.Type.GetMethod (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) (at :0)
ILRuntime.Reflection.ILRuntimeWrapperType.GetMethodImpl (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) (at Assets/Scripts/ILRT/ILRuntime/Reflection/ILRuntimeWrapperType.cs:117)
System.Type.GetMethod (System.String name, System.Reflection.BindingFlags bindingAttr) (at :0)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at :0)
ILRuntime.CLR.Method.CLRMethod.Invoke (ILRuntime.Runtime.Intepreter.ILIntepreter intepreter, ILRuntime.Runtime.Stack.StackObject* esp, System.Collections.Generic.IList`1[T] mStack, System.Boolean isNewObj) (at Assets/Scripts/ILRT/ILRuntime/CLR/Method/CLRMethod.cs:316)
ILRuntime.Runtime.Intepreter.ILIntepreter.Execute (ILRuntime.CLR.Method.ILMethod method, ILRuntime.Runtime.Stack.StackObject* esp, System.Boolean& unhandledException) (at Assets/Scripts/ILRT/ILRuntime/Runtime/Intepreter/ILIntepreter.cs:1797)
Rethrow as ILRuntimeException: Exception has been thrown by the target of an invocation.
IL_0049: callvirt System.Reflection.MethodInfo System.Type::GetMethod(System.String,System.Reflection.BindingFlags)
Common.ListController..cctor()
The text was updated successfully, but these errors were encountered: