Any updates regarding .NET4 RTM / Unity 2 compatibility?

Apr 22, 2010 at 8:55 AM

Any schedule for a release compatible with MEF in .NET4?

Any schedule for a release compatible with Unity 2? (Which is also in release now as part of http://entlib.codeplex.com/)

 

/Steinar

Apr 22, 2010 at 4:32 PM

I would like to know same.

Regards

Coordinator
Apr 22, 2010 at 6:50 PM
Hi, I spoke to Piotr earlier today and he told me he was going to resolve this asap. Sometime between now and next Monday we are going to put out a .net 4 version of mefcontrib as well. It would be really cool if you guys could tell us abit about your unity <-> mef integrations .. we are currently looking into further expanding the Mef <-> IoC story and knowing what people currently do and what they'd like to do would help us a lot at focusing our efforts in the right direction. Thank you!
Apr 22, 2010 at 9:48 PM
Edited Apr 22, 2010 at 9:49 PM

Hello,

That is good news. I was using Unity in my current project and just recently switched to MEF. The reason I switched to MEF is simplicity. What I miss is now is flexibility in 5% of cases. With minor refactoring I am able to use MEF, but Unity integration would help me in the cases where I need to dynamically compose objects based on the input parameters. Constructor parameters injection is another feature I miss in MEF.

Cheers   

 

Apr 23, 2010 at 7:16 AM
Edited Apr 23, 2010 at 7:56 AM

Regarding usage:

 

geoCache: I'm one of the maintainers of geocache.codeplex.com, which is currently using Unity. Having used MEF on various other projects i find it a much better fitt for extensions in geocache. Since we allready use unity, and others might have written extensions for geoCache using unity, a good integration between the two through mefcontrib is very nice.

 

UnitTesting: Testing MEF "components" is not easy without a good way to supply dependencies. Mefcontrib has made this much more easy because we can now satisfy mef-imports using  unity. Like this extension-method:  

public static UnityContainer ConfigureMefContainerForTesting(this IEnumerable<Type> types)
	{
		var unityContainer = new UnityContainer();
		var catalog = new TypeCatalog(types);
		var provider = new UnityExportProvider(unityContainer);
		var container = new CompositionContainer(catalog, provider);
		MefContainer.SetContainerForTesting(container);
		return unityContainer;
	}
}

 

 

Coordinator
Apr 25, 2010 at 11:38 AM

MefContrib.Integration.Unity is now fully compatible with Unity 2.0. Please note that at the same time we have dropped support for the Unity 1.2. Nevertheless, it should be easy to port it back to previous version. One important thing: as of now, there is NO official release of Unity 2.0. Recently released EntLib 5.0 contains Unity 2.0 RTM for regular CLR only, so to maintain the integration layer for SL, we had to manually compile Unity.

.NET 4.0 release is coming soon...

Regards,

Piotr

May 9, 2010 at 4:44 PM

Any update on .Net 4.0 release?

Regards

Coordinator
May 9, 2010 at 8:02 PM
Edited May 9, 2010 at 8:02 PM

Hi, 

We posted a .net 4 (along with Silverlight 4 and VS2010) compatible version over at our github repository http://github.com/MefContrib/MefContrib if you do not know Git, do not worry, you can just use the Download Source

button at the top, to get it as a zip (or tar) file. Please read http://www.thecodejunkie.com/2010/04/mefcontrib-has-moved-bought-new-shoes.html for more information.

Let us know if you have any questions!