开发者

Sharing Types between AppDomains

开发者 https://www.devze.com 2023-01-26 16:22 出处:网络
I am currently developing an add-in system for a program I am writing, and have run into the issue of how the host and add-in should communicate on a common base. I use the System.AddIn namespace (pre

I am currently developing an add-in system for a program I am writing, and have run into the issue of how the host and add-in should communicate on a common base. I use the System.AddIn namespace (previously called the MAF) for discovery, isolation, and activation of add-ins.

Now, since I want (need?) add-ins to exist in separate AppDomains from the host, there exists the problem that types cannot be开发者_StackOverflow中文版 shared between AppDomains and thus not between host and add-in. I understand there is some built-in support for type marshalling between AppDomains, but know nothing about this, nor whether it is even appropriate.

So the question is, what can I do if I want to share the same object (instance) between add-in and host in two separate app-domains? Perhaps there is a more subtle way around this problem?


So it seems MarshalByRefObject and a few functions on the AppDomain object provides the basis for exactly what I want. Case closed for now, I think.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号