Pumping Windows Messages During Long Operation?
As I know this thing happens with attached debugger only. You will never get this exception in production.
It's unclear exactly what the context is - are you performing some long-running task on the UI thread of a WinForms or WPF app? If so, don't do that - use BackgroundWorker
, or run the task on the thread pool or a new thread directly (possibly using Control.Invoke/BeginInvoke
or Dispatcher
if you need to update the UI). If your big operation uses the COM component which is complaining, it'll be harder...