Share via

Unhandled Exception: System.InvalidOperationException: The Dispatcher is unable to request processing. This is often because the application has starved the Dispatcher's message pump. Is thrown from Windows base dll.

Raja Vignesh 1 Reputation point
2022-07-27T16:33:52.357+00:00

Hi ,

We have a project attached with the sample. We use dispatchers in the project to made the changes to the sample’s UI. We also start a dispatcher timer with 5 milliseconds which ran until the application runs. In the Tick event of the dispatcher timer we handle the virtualization process. If we ran the sample along with the application normally, it runs properly without any error.

But if we set the HandleDispatcherRequestProcessingFailure property in the sample side, the “Unhandled Exception: System.InvalidOperationException: The Dispatcher is unable to request processing. This is often because the application has starved the Dispatcher's message pump” exception throws and the application breaks. We tried to handle the error in the DispatcherUnhandled event in the App.xaml.cs class file and also in the thread in which the dispatcher is invoked but it is not get caught by the event in any of the places. We have also tried the try/catch block for the dispatchers used in the project, but nothing works. We have also checked whether the error is got in the runWorker_completed event, but it also not worked. How to catch the exception in DispatcherUnhandled event or handle the exception in the sample side?

Thanks.

Developer technologies | Windows Presentation Foundation
Developer technologies | XAML
Developer technologies | XAML

A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.