I have an app where there are several threads, and most of the time they are just waiting for an event to happen (eg with a AutoResetEvent.Wait).
In such a case if I try to use the immediate window to execute commands I get "Cannot evaluate expression because the current thread is in a sleep, wait, or join", no matter what thread I use. I'm wondering if there's any trick that can be used to eg make the thread stop waiting (like somehow set the AutoResetEvent).
I've read Debugging whilst paused and 'cannot evaluate expression' so I fear it's probably not possible.
I think your only options
Basically without having managed thread that is not stuck in native code you can't safely run managed code in debugged process (nothing new in this area since linked 2010 question).