what is benefit from using import and export attribute in mef using .net 4.0 ? RRS feed

  • Question

  • i read on some sites bout mef framework and not understand any thing

    can you tell me why using export and import attributes and what is befit ?

    please show me any simple example ?

    using System.ComponentModel.Composition;
    using MefShared.Interfaces;
    namespace MefAuthentication
        [ExportMetadata("AuthenticationType", "3")]
        public class ThirdAuthentication : IAuthentication
            public string Authenticate(string username, string password)
                return "Authentication Implementation 3 is invoked";

    Here is export why use export here 

    I already use inheritance 

    so why use Export 

    Monday, December 16, 2019 1:13 AM


All replies