Export Based on Metadata?

Aug 7, 2009 at 6: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?

Thanks,

Michael

Aug 7, 2009 at 6:16 PM

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

Cheers

Nick

Aug 7, 2009 at 6:28 PM

Agree with Nick. You could look at using CCI (http://ccimetadata.codeplex.com/) to read in the assembly metadata without loading to make the determination.

HTH

Glenn

Aug 7, 2009 at 7: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