InvalideOperationException / invoke
问题 the following code is used to trigger invoke (code is reduced, i left out the error handling in this example to make it more clear) public static void InvokeIfNecessary(this Control control, MethodInvoker methodInvoker) { if (control != null && !control.IsDisposed && !control.Disposing) { if (control.InvokeRequired) { control.Invoke(methodInvoker); } else { methodInvoker(); } } } Normally it works fine, but sometimes if i call a method of a Form an InvalidOperationException is given.