You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling (Dispatcher.)VerifyAccess() (typically through NotifyPropertyChangedDispatcherBase) from a non dispatcher-affined thread (typically, any threadpool thread) causes an application crash. Yet, this is a very common developer mistake that results in wasted time at the very least.
Detecting the dispatcher context of calls to VerifyAccess seems possible, though computationally intensive. Doing a fixed N-level deep search on code in the scope of a switch to the threadpool seems like it might be less computationally expensive, and still provide value.
However, perhaps the biggest challenge would be to resolve variant runtime behavior in order to properly detect invalid code. e.g.
context.Switch(await context.ToThreadPool());
if (x) context.Switch(await context.ToSyncContext());
if (y) VerifyAccess();
The text was updated successfully, but these errors were encountered:
Calling
(Dispatcher.)VerifyAccess()
(typically throughNotifyPropertyChangedDispatcherBase
) from a non dispatcher-affined thread (typically, any threadpool thread) causes an application crash. Yet, this is a very common developer mistake that results in wasted time at the very least.Detecting the dispatcher context of calls to
VerifyAccess
seems possible, though computationally intensive. Doing a fixed N-level deep search on code in the scope of a switch to the threadpool seems like it might be less computationally expensive, and still provide value.However, perhaps the biggest challenge would be to resolve variant runtime behavior in order to properly detect invalid code. e.g.
The text was updated successfully, but these errors were encountered: