Bug 10795 - Enhancement: Add System.ComponentModel.Composition.dll to the Xamarin profile
Summary: Enhancement: Add System.ComponentModel.Composition.dll to the Xamarin profile
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 6.3.x
Hardware: All All
: Lowest enhancement
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-03-01 00:51 UTC by patricksissons
Modified: 2013-06-02 12:20 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:
Status:
RESOLVED FIXED

Description patricksissons 2013-03-01 00:51:14 UTC
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
Comment 1 patricksissons 2013-03-01 02:51:18 UTC
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.
Comment 2 Mikayla Hutchinson [MSFT] 2013-03-01 03:59:10 UTC
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.
Comment 3 patricksissons 2013-03-01 04:02:15 UTC
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.
Comment 4 Mikayla Hutchinson [MSFT] 2013-03-01 04:04:32 UTC
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.
Comment 5 Miguel de Icaza [MSFT] 2013-03-04 11:06:53 UTC
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.
Comment 6 patricksissons 2013-03-04 11:26:36 UTC
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.
Comment 7 Sebastien Pouliot 2013-06-02 12:20:21 UTC
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.