I am just getting started with MEF and hoping to integrate it with an application I'm currently working on. I am wondering if it is possible in MEF to discover parts in assemblies that are in the GAC. Essentially I would like something similar to the DirectoryCatal开发者_C百科og but that would search the GAC. Is there anything like this out there?
I don't think there is anything like this out there. I don't think it's a good idea to do this, because it would mean loading each and every assembly in the GAC into your process.
If you want to do it anyway, the hard part is getting a list of assemblies in the GAC. After that you can just create an AssemblyCatalog for each one, and put all of the AssemblyCatalogs in a DirectoryCatalog.
精彩评论