Is there an equivalent of ApplicationCatalog in VS MEF?
#702
-
|
Hi, I'm using gives me proper result but takes literally ~5 minutes to execute, and that is only for a single assembly... |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
|
I've never used
That's trivial to reproduce with VS-MEF. Enumerate the files you want to include in the catalog (e.g. We use this in Visual Studio to scan 300 assemblies in several seconds. One assembly shouldn't ever take 5 minutes unless (maybe?) it was 1GB in size or you had a debugger attached that was slowing it down. And yes, VS-MEF produces much better diagnostics for catalog and composition level errors. |
Beta Was this translation helpful? Give feedback.
-
|
Right, that could explain why I have composition failure in the first place. Not sure why I just assumed the |
Beta Was this translation helpful? Give feedback.
-
|
But that would require to make the calling methods async, all they way to |
Beta Was this translation helpful? Give feedback.
-
|
Well, that didn't work as I expected :/ [Export(typeof(FileConverter))]
public class CNC_SVG_Converter : FileConverter {}but If I give it a type only containing import members, it doesn't pick that: public class Office : IToolClient {
#region MEF Components
/// <summary>Stores external MEF workstations.</summary>
[ImportMany]
protected IEnumerable<Lazy<WorkStation>> externalWorks;
} |
Beta Was this translation helpful? Give feedback.
I've never used
ApplicationCatalog, but based on its summary doc:That's trivial to reproduce with VS-MEF. Enumerate the files you want to include in the catalog (e.g.
Directory.EnumerateFiles) and pass that toPartDiscovery.CreatePartsAsync.We use this in Visual Studio to scan 300 assemblies in several seconds. One assembly shouldn't ever take 5 minutes unless (maybe?) it was 1GB in size or you had a debugger attached that was slowing it down.
And yes, VS-MEF produces much better diagnostics for catalog and composition level errors.