Avoid async deadlock in InteractiveHost...
The scheduler returned by TaskScheduler.FromCurrentSynchronizationContext does not allow concurrency (meaning all Tasks within a submission were being inlined). This would nearly always result in a deadlock if you kicked off a child Task and attempted to continue within the same submission. We can instead use the Winforms Dispatcher, which will invoke the parent Task on the "UI" thread but allow child Tasks to use the ThreadPool.
Showing
想要评论请 注册 或 登录