Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
System.ComponentModel.Composition provides the MEF framework. Would be nice if we could use MEF within a xamarin project, instead of using a third party implementation such as pocketMEF.
mono added System.ComponentModel.Composition in 2.8.x
I don't agree with the new product specified for this bug/enhancement. this is not monotouch related, MEF composition should be available to all platforms. I am specifically interested in using this with android, but eventually also with iOS.
System.ComponentModel.Composition is already in the Mono class libraries - whether to include it in the Xamarin.iOS/Android profiles is a product specific decision. That;'s the reason for the product assignment.
I see, i thought that class libraries represented Xamarin's compilation of the mono class libraries for all platforms. So really this bug would need to be replicated per platform. Though i imagine that the development cost of bringing it to one platform essentially brings it to all platforms.
Nope, Xamarin.iOS/Android use the "Mono mobile" profile of the class libraries, which is a superset of the non-UI Silverlight class libraries with some classes/methods from the "full" desktop/server class libraries added back.
I have serious doubts that something like MEF will work on iOS, given its very dynamic nature which is at odds with the fact that no dynamic code generation can take place on iOS.
Unless proven wrong by working samples of the open source effort, I am setting the priority of this request to lowest.
I can already confirm that MEF works out of the box with pocketMEF on android. Due to the way Xaramin does assembly generation (or package creation, i'm unsure of the specific issue here) i have to reference all potentially used MEF assemblies in the main (startup) project. However, MEF as a pattern works almost exactly as expected. The only slight modification required to the pattern is to use AssemblyCatalog entries (instead of DirectoryCatalog entires like you would for most applications of MEF), and create those AssemblyCatalog's by using Assembly.Load("dll_name"). Since we referenced the MEF composable assemblies in the root project, they will be automatically loaded by name.
Since MEF catalog generation is platform dependent anyways (i.e. the Shell lives in some platform dependent project), we don't need to worry about deviating from the MEF pattern too much. Essentially we are still left with an MEF-based solution that is highly portable to other platforms.
I can't speak much for iOS because i'm not interested in targeting iOS at this time, but i would have to assume that this strategy is still very possible on that platform.
System.ComponentModel.Composition.dll is shipped with the latest 6.3.x builds. However, as stated above, YMMV on how it will behave with iOS.