1

I've run into a situation where a singleton static class I'm using in appdomain A needs to be accessed from appdomain B. I've already tried passing a a serializable object that has properties wrapping the singleton to appdomain B, but that just recreates the singleton in appdomain B. I'm really not all that familiar with the ways you can communicate between appdomains. Is there some remoting library that actually ensures that the code is executed inside appdomain A while being called from appdomain B? Can someone point me in the proper direction here?

Thanks!

Isaac Bolinger
  • 7,328
  • 11
  • 52
  • 90

1 Answers1

1

I ended up firing an event from appdomain B to appdomain A, and calling the singleton in the event handler in appdomain A. The remoting stuff is all automatic. A couple problems I came across though were that the remoted proxy objects I was using expire after 5 minutes by default ( have to set the expiry to a longer time) and also the class in appdomain A where the event handler is must inherit from MarshalByRefObject or else the code is actually executed in appdomain B (even though its in the appdomain A class).

Isaac Bolinger
  • 7,328
  • 11
  • 52
  • 90