-
-
Notifications
You must be signed in to change notification settings - Fork 7
Quickstart
https://www.nuget.org/packages/MSEF/ Download via Nutget Package. If you are using the command line type:
PM> Install-Package MSEF
else search for MSEF
Call
ServicePoolFactory.CreatePool()
in you'r executable as soon as possible. You can wrap it into a Task if necessary.
Create a DLL called (Name is just Semantic sugar) *.Contracts.dll where * is your application common name. Inside this DLL Extend the IService interface for your Business logic like IFooService. All shared Definitions that must be known to all of your DLL's should be located here, there must be no direct connection between each Dll.
Implement your interface IFooService and mark it for export by using the ServiceExportAttribute located in the JPB.Shell.Contracts DLL.
Ensure that all DLL's are compiled into the same folder as the Startup Project. To enforce this set the Output path of each DLL you use, to the same path like
..\..\..\..\bin\VS Output\
This will ensure that the MSEF can find all corresponding DLL's
Obtain your IFooService implimentation ANYWHERE by calling JPB.Shell.MEF.Services.ServicePool.Instance.GetSingleService()
if you followed the steps exactly you will obtain your service without knowing the Implementation. If you are struggling with that feel free to contact me: Jean-Pierre_Bachmann@live.de (Englisch or German Preferred)