1

I need to pass an instance to (not from) an AppDomain. I've seen a lot of info about how to do the reverse (call create on a domain and use the object locally), but what i want is to pass an instance i already have (not one i create from the domain object), this instance is a MarshalByRefObject and i want to pass it to another domain from my main domain. Is this possible at all?

   var MyObject = GetAlreadyPopulatedObject();
   AnotherDomain.MakeObjectVisible(MyObject); // this is what i'm trying to do, make the instance i have available somewhere else
   // And if it's possible, how would i access it from the other Domain? How can i find it?

The scenario i have is i'm handling data that i create, i want to pass it for manipulation to a plugin in another appdomain, and then to retrieve the modified version and i'm a bit at a loss.

2
  • The point of MBRO is that the code in the other appdomain uses a proxy and not the real object. If that's not what you want then you should not use MBRO and make it [Serializable] instead. Commented May 25, 2013 at 20:36
  • My items can be serializeable too, but i couldn't find how to pass them across domain, i've found SetData and GetData in between but i hoped there was a richer way to work with that Commented May 25, 2013 at 22:33

1 Answer 1

0

In the end i found an alternative (domain.SetData / domain.GetData) to pass objects across domain boundaries, i'm not sure if it's the cleanest / easiest / fastest / recommanded etc to do this so not marking myself as an answer unless i see no other answers after a while.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.