This project has moved and is read-only. For the latest updates, please go here.

Export Based on Metadata?

Aug 7, 2009 at 7:12 PM

Hello all,

Is it possible to find exports based on types that are decorated with a certain type of Attribute?  In this case I'm only interested in finding exports in assemblies decorated with a specific assembly-level attribute.  Is there some magic way of making this happen or do I have to explicity check assemblies' CustomAttributes to get what I'm looking for?



Aug 7, 2009 at 7:16 PM

There's no magic way - the best approach is to filter Assemblies before adding them to an AssemblyCatalog.



Aug 7, 2009 at 7:28 PM

Agree with Nick. You could look at using CCI ( to read in the assembly metadata without loading to make the determination.



Aug 7, 2009 at 8:44 PM

OK cool... just making sure I wasn't missing something obvious.  I just incorporated my first take of MEF into my solution.  Looking good. :D