public interface IPluginMetadata{ string Name { get; } [DefaultValue(1)] int Version { get; }}[Export(typeof(IPlugin)), ExportMetadata("Name", "Logger"), ExportMetadata("Version", 4)]public class Logger : IPlugin{}[Export(typeof(IPlugin)), ExportMetadata("Name", "Disk Writer")] //Version is not required because of the DefaultValuepublic class DWriter : IPlugin{}//----public class Addin{ [Import] public Lazyplugin;}//-------public class User{ [ImportMany] public IEnumerable > plugins; public IPlugin InstantiateLogger () { IPlugin logger = null; foreach (Lazy plugin in plugins) { if (plugin.Metadata.Name = "Logger") logger = plugin.Value; } return logger; }}//------