[NBug] Invoke or BeginInvoke cannot be called on a control until t...

Author: roeldebCreated May 13, 2026Updated Sep 19, 2026
Labels:eyeglasses: status: needs reviewneeds-area-label

Environment

  • Git Extensions 6.0.5.18375
  • Build 069d8b7789e806682c97baaeca36e5f3b8b0973f
  • Git 2.54.0.windows.1
  • Microsoft Windows NT 10.0.26200.0
  • .NET 9.0.16
  • DPI 96dpi (no scaling)

Issue description

System.InvalidOperationException: Invoke or BeginInvoke cannot be called on a control until the window handle has been created.
   at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
   at System.Windows.Forms.Control.BeginInvoke(Delegate method, Object[] args)
   at Microsoft.VisualStudio.Threading.JoinableTask.Post(SendOrPostCallback d, Object state, Boolean mainThreadAffinitized)
   at System.Threading.Tasks.AwaitTaskContinuation.RunCallback(ContextCallback callback, Object state, Task& currentTask)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.QueueUserWorkItemCallback.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

Steps to reproduce

It just popped up, no idea what could be the cause of this crash.

Happened after installing latest Visual Studio version.

Did this work in previous version of GitExtensions?

No response

Diagnostics

No response

Source: gitextensions/gitextensions