.net - Can IoC and the Managed AddIn Framework (System.AddIn) work together with isolated AppDomains? -


if use managed addin framework (system.addin) , set use separate appdomains, can use centralized ioc container in primary/default appdomain? can ioc container resolve across appdomains?

i'm going approach answer ignoring maf part of equation, , concentrating on appdomain issue. ioc container theoretically describe, assuming ioc entry point inherits marshalbyrefobject or wrapped class in turn inherits marshalbyrefobject. 29k+ rep score, sure know but:

1) objects inherit marshalbyrefobject can accessed across appdomain boundaries via proxying (that is, of calls marshalled across appdomain boundary object).

2) objects serializable can passed across appdomain boundary via serialization, is, can copy of them in other appdomain.

for number of reasons, wouldn't want serialize whole ioc container , ship across appdomain boundary. first off, overhead of doing enormous, , secondly there lot of plumbing behind ioc container isn't serializable. therefore possible way work if:

1) ioc container marshalbyref, or wrapped such

and

2) objects getting ioc container set cross-domain use (either serializable or mbr-inheriting).

if both of above true, theoretically use ioc container hosted in main appdomain other appdomains. you'd defining maf host adapter specific ioc container's resolve methods (or whatever equivalent in ioc tool use).

keep in mind lot of ioc functionality (especially aop) implemented using same proxy apis cross-appdomain communication uses. see complicating things if attempt use ioc container more basic serializable structures , mbr-inheriting services.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -