MEF - Microsoft.Composition nuget support
Am trying to use Microsoft.Composition 1.0.3 in my web MVC project using latest DNX 5.0 beta 8. But it is not composing my simple plugin interfaces using the WithDefaultConventions for Type and Derived Types. The only time it worked is using the WithAssembly in a console app but cannot run in web app because of the inability to utilize System.Reflection.
Any pointers to help here are greatly appreciated.
How are you plugging in MEF into the application? Do you have an adapter that works with DependencyInjection.Abstractions?
but cannot run in web app because of the inability to utilize System.Reflection. Your web app should be able to System.Reflection just fine.
It is in similar lines to the sample given is https://mef.codeplex.com/wikipage?title=What%20is%20Microsoft.Composition%3f&referringTitle=Documentation Basically the plugin is based on Export attributes and no DI is used. Also, adding the reference to System.Reflection gives the following error: Error CS0117 'Assembly' does not contain a definition for 'GetExecutingAssembly' WebApplication.DNX Core 5.0
MEF hasn't been ported to work on .NET Core, so running on .NET Core (dnxcore50) won't work. You should be able to use MEF on the full .NET Framework though.
Any updates on this? I am thinking of developing a .Net Core class library with MEF or any other alternative approaches so far?
Thanks in advance.
Have you taken a look at. https://www.nuget.org/packages/Microsoft.Composition/