WPFでConfigureAwait(false)を使うとUIスレッドで例外が発生する理由

WPFアプリケーションで非同期メソッドを扱う際、ConfigureAwait(false) を付けると UI 要素にアクセスできなくなるケースがよくある。次の最小構成で再現してみる。 画面定義(XAML) <Window x:Class="Demo.AsyncAwaitWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/ ...

6月6日 21:26 投稿