I think that System.Windows.Threading.Dispatcher is available if you create a "WPF Class Library" project.
If you want to use it in your "Class Library" project, then try opening the project XML (double-click it in Solution Explorer), replace <TargetFramework>net6.0</TargetFramework> with <TargetFramework>net6.0-windows</TargetFramework><UseWPF>true</UseWPF>, and save it.