The system has an exception: parameter count mismatch, unhandled System.Reflection.TargetParameterCountException, the system will display the following exception information, but the exception information is often with the actual location of the exception 108,000: not processed system.reflection.targetparametercountexception message= parameter Count mismatch. source=mscorlib stacktrace: in System.Reflection.RuntimeMethodInfo.Invoke ( Object obj, BindingFlags invokeattr, Binder binder, object[] parameters, CultureInfo culture, Boolean Skipvisibilitycheck s) at System.Delegate.DynamicInvokeImpl (object[] args) in System.Windows.Forms.Control.InvokeMarshaledCallbackDo (threadmethodentry tme) in System.Windows.Forms.Control.InvokeMarshaledCallbackHelper (Object obj) in System.Threading.ExecutionContext.runTryCode (Object userData) in System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup (TryCode code, CleanupCode Backoutcode, Object userData) in System.Threading.ExecutionContext.runinternal (ExecutionContext ExecutionContext, ContextCallback callback, Object State) in System.Threading.ExecutionContext.Run (ExecutionContext ExecutionContext, ContextCallback callback, Object State) at System.Windows.Forms.Control.InvokeMarshaledCallback (Threadmethodentry tme) at System.Windows.Forms.Control.InvokeMarshaledCallbacks () System.Windows.Forms.Control.WndProc (message& m) in System.Windows.Forms.ScrollableControl.WndProc (message& m) in System.Windows.Forms.ContainerControl.WndProc (message& m) in System.Windows.Forms.UserControl.WndProc (message& m) in System.Windows.Forms.Control.ControlNativeWindow.OnMessage (message& m) in System.Windows.Forms.Control.ControlNativeWindow.WndProc (message& m)   in System.Windows.Forms.NativeWindow.DebuggableCallback (IntPtr hWnd, Int32 msg, INTPTR wparam, INTPTR lparam) & nbsp at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW (msg& MSG) in System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMess Ageloop (Int32 Dwcomponentid, Int32 reason, Int32 pvloopdata) in System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner (Int32 reason, ApplicationContext context) in System.Windows.Forms.Application.ThreadContext.RunMessageLoop (Int32 reason, ApplicationContext context) System.Windows.Forms.Application.Run (applicationcontext Context) in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun () in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationMOdel () Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run ( String[] commandLine) location in PCMax.Main.My.MyApplication.Main (string[] Args) 17d14f5c-a337-4978-8281-53493378c1071.vb: Line number 81 in system.appdomain._nexecuteassembly ( Assembly Assembly, string[] args) in System.AppDomain.ExecuteAssembly (String assemblyfile, Evidence assemblysecurity, string[] args) in Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly () in System.Threading.ThreadHelper.ThreadStart_Context (Object State) in System.Threading.ExecutionContext.Run (ExecutionContext ExecutionContext, ContextCallback callback, Object State) in System.Threading.ThreadHelper.ThreadStart () innerexception: According to the actual situation of commissioning, This exception is not correctly matched when using the invoke call, because the number of arguments to the invoke or BeginInvoke method is variable, so there is no compile error at all during the compile phase, but the program formallyWhen executing, it is also required that the target invocation method and the method definition of the delegate must be consistent, and if inconsistent, the exception information will appear.
Parameter count mismatch, unhandled System.Reflection.TargetParameterCountException