I have an Office add-in that tracks documents open in various instances
of Word and Excel. This "tracker" object is a Singleton Well-Known
object registered with .Net remoting.
I use a MarshalByRefObject-derived proxy class that has an internal
reference to the document object. This proxy is used to "send" the
document over remoting. The problem appears when the "tracker" calls a
method on the proxy which in turn accesses a property (FileName or
something) on the document object. What happens is that it simply locks.
I tried creating a separate STA thread for this, with no effect. What
should I do? Colud it be that the document object gets confused when
called inside a remoting context? Maybe this call should have been
dispatched to the UI's primary thread (no idea how to do this with
office)? Any ideas?
Thanks in advance!