Quantcast
Channel: Managed Extensibility Framework
Viewing all articles
Browse latest Browse all 265

New Post: Composing/Ignoring different parts based on context

$
0
0
Hello,

We currently use MEF like this:

Machine A:
  • Server.exe
  • ServerOnlyStuff.dll
  • MEF.Extension1.Server.dll
  • Extension1.Shared.dll
Machine B:
  • Client.exe
  • ClientOnlyStuff.dll
  • MEF.Extension1.Client.dll
  • Extension1.Shared.dll
That is, we keep assemblies imported by the font end separate from those imported by the back end. This way, Server.exe doesn't need to know about ClientOnlyStuff.dll, and Client.exe doesn't need to know about ServerOnlyStuff.dll. It keeps out unnecessary dependency.

I'd like to do this instead:

Machine A:
  • Server.exe
  • ServerOnlyStuff.dll
  • MEF.Extension1.dll <-- Same DLL
Machine B:
  • Client.exe
  • ClientOnlyStuff.dll
  • MEF.Extension1.dll <-- Different Context
If I set this up, composition chokes (ReflectionTypeLoadException). On Machine A this is because MEF.Extension1.dll references ClientOnlyStuff.dll, which is not there. On Machine B it chokes because MEF.Extension1.dll references ServerOnlyStuff.dll, which is not there.

I would like to be able to compose only the parts whose dependencies are present. This way a single dll could provide context-appropriate functionality in a number of locations.

One way to do this would be to allow developers to specify which namespace, within the target assembly, they're after.

Is there anything like what I'm talking about that I've missed, or is this a feature request?

Thanks for taking the time to read this, and thanks in advance for any advice you have for me.

Viewing all articles
Browse latest Browse all 265

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>