>>478
stackoverflow.com/questions/68300971/wpf-dispatcher-for-dotnet-5
.NET 5の話だけど、6でも同じはず
プロジェクトファイルに
<UseWPF>true</UseWPF>
を追加する