Hi all
apologies for the title, I got stuck for words
I'm dipping my toes in the MEF pond. So far, so good. I've got a host app and a couple of "plugin" assemblies that export things. The host app defines an attribute called DescriptionAttribute
which inherits from ExportAttribute
and has a simple Name
property. My test form has an <ImportMany>
IEnumerable(Of Lazy(Of IDoStuff, IDescriptionAttribute))
. This gets nicely filled by MEF, I can spin through the collection, the Name
property is filled in, life is golden. I'll split things out into separate assemblies later on, at the moment it's just a proof of concept.
Now, the question is: Is there any way I can expose the assembly version of the IDoStuff
implementing, DescriptionAttribute
wearing "plugin" classes through the DescriptionAttribute
attribute that I have? All my attempts so far at passing it to the constructor of the attribute have failed, studio keeps telling me that a constant expression is required (understandably). I can expose it through the IDoStuff interface, but it'd be much nicer to have it as part of the DescriptionAttribute
attribute instead, that "feels" better. I can also hardcode it, but it's another spot that I'd forget to update when releasing a new version of a "plugin" :-)