N-Layer using MEF dependency injection on MVC project
Security

MEF is a lightweight framework for discovering plugins at runtime. Be wary that plugins are loaded using the same security and evidence of the container code. Anyone deploying malicious TreeOfMana*.ddl in your output folder has the same access rights to the system as your application.


var files = Directory.GetFiles(
    AppDomain.CurrentDomain.BaseDirectory, "TreeOfMana*.dll",
        SearchOption.AllDirectories)
            .Where(o =&gt; !o.Replace(AppDomain.CurrentDomain.BaseDirectory,
                 "").Contains("obj\\"));



MAF comes with built-in functionality to provide separate and limited permissions for addins. But I'm not sure whether or to which degree this framework is still supported. If you keep using MEF, make sure no malicious code could get access to the system. Some considerations:


Assembly Security
Create a dedicated Application Domain for running plugins
You could create custom authentication with DLL license keys