I am using DevExpress DockManager. When I undock a window containing a MapView, my application deadlocks. The attached image shows the deadlocked threads. The reason for the deadlock is because on the Main Thread, HostedSurfaceElement.CreateHostedElementOnWorkerThread starts a thread to call HostedSurfaceElement.SurfaceBackgroundUiWorker and then calls this._backgroundUiCreatedEvent.WaitOne() to wait for the SurfaceBackgroundUiWorker method to complete. However, the method sets the RootVisual which ultimately causes ResourceDictionary.GetValue to be called, causing the deadlock.
Is there a way around this?
Any chance you could share a simple application that reproduces the issue?
As a workaround you could try and enable a legacy-mode that disables the secondary UI thread (just note it could potentially have a small performance impact) :
Note: You'll need to use v100.7 for this switch to work (if you can't move to 100.7, at least just try it briefly just to confirm whether this is the addresses the issue, so it gives us something more to go on wrt trouble-shooting). Also this switch might or might not continue to have an effect in future releases, so providing a reproducer sample would be helpful so we can try and address any issue there might be here.
Thank you for the response.
Unfortunately, I am unable to reproduce this issue outside of my application.
The issue is resolved after upgrading to v100.7 and adding the
On a side note, we often observe issues related to unobserved Task exceptions. We stopped using some async calls due to this.
We will make an effort to provide more details to you related to these issues in the future.
Until those issues are resolved, we hope that the switch will retain its effect.