Writing C# Plugin System

前端 未结 3 1731
没有蜡笔的小新
没有蜡笔的小新 2020-11-27 11:48

I\'m trying to write a plugin system to provide some extensibility to an application of mine so someone can write a plugin(s) for the application without touching the main a

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-27 12:46

    The Managed Extensibility Framework (MEF) is a new library in .NET that enables greater reuse of applications and components. Using MEF, .NET applications can make the shift from being statically compiled to dynamically composed. If you are building extensible applications, extensible frameworks and application extensions, then MEF is for you.

    http://www.codeplex.com/MEF

    Edit: CodePlex is going away - the code has been moved to Github for archival purposes only: https://github.com/MicrosoftArchive/mef

    MEF is now a part of the Microsoft .NET Framework, with types primarily under the System.Composition. namespaces. There are two versions of MEF

    • System.ComponentModel.Composition, which has shipped with .NET 4.0 and higher. This provides the standard extension model that has been used in Visual Studio. The documentation for this version of MEF can be found here
    • System.Compostion is a lightweight version of MEF, which has been optimized for static composition scenarios and provides faster compositions. It is also the only version of MEF that is a portable class library and can be used on phone, store, desktop and web applications. This version of MEF is available via NuGet and is documentation is available here

提交回复
热议问题