Let’s start with the following code: You throw exception as soon as your form is loaded, however, catch block is not executed. What happens? Initially I though this is out of band exception which is thrown on another thread. But after some debugging the reason is much simpler. WinForms provide special event handler for unhandled … Continue reading Exception propagation in WinForms
Tag: Winforms
Async Wandering Part 3 — Awaiting in synchronous WinForms code
This is the third part of the Async Wandering series. For your convenience you can find other parts in the table of contents in Part 1 – Why creating Form from WinForms in unit tests breaks async? async and await are great features of C#. By using them we can hide all cumbersome details of … Continue reading Async Wandering Part 3 — Awaiting in synchronous WinForms code
Async Wandering Part 2 — Synchronous call on WinForms control and ObjectDisposedException
This is the second part of the Async Wandering series. For your convenience you can find other parts in the table of contents in Part 1 – Why creating Form from WinForms in unit tests breaks async? I once found the following code in some WinForms application: Here Control is any WinForms control, usually some … Continue reading Async Wandering Part 2 — Synchronous call on WinForms control and ObjectDisposedException
Async Wandering Part 1 — Why creating Form from WinForms in unit tests breaks async?
This is the first part of the Async Wandering series. For your convenience you can find other parts using the links below (or by guessing the address): Part 1 — Why creating Form from WinForms in unit tests breaks async? Part 2 — Synchronous call on WinForms control and ObjectDisposedException Part 3 — Awaiting in … Continue reading Async Wandering Part 1 — Why creating Form from WinForms in unit tests breaks async?