次の方法で共有


What’s new in MEF 2 Preview 5? [Alok, Nick]

Nearly two months since we published MEF 2 Preview 4, we have just posted our fifth preview on the MEF CodePlex site.

The new preview has been shaped by your feedback; everyone who took the time to download, evaluate or comment on the last version, thank you!

So, what has changed since Preview 4?

  • CompositionException.RootCauses, previously only visible in the debugger, can now be accessed directly in code
  • Using RegistrationBuilder, all interfaces on a part can now be exported using the ExportInterfaces method
  • IDisposable and IPartImportsSatisfiedNotification will now be filtered out by RegistrationBuilder automatically (these should never be exported)
  • CompositionProvider in the ASP.NET MVC integration now exposes ApplicationSharedPartMetadataKey for those wishing to create their own sharing conventions compatible with the provider
  • Some additional performance tuning has been done

As we get closer to making our next supported release as part of the .NET Framework, the bar is now high for changes to be included in MEF 2. Even so, we’d love to hear about your experiences with the new preview, and planning for MEF 3 is just around the corner. You can get in touch via this blog or through the discussion forum and issue tracker on CodePlex.

Comments

  • Anonymous
    December 19, 2011
    Hi, if MEF 3 is about to enter planning stage, I have a long standing feature request. I've always wanted an easier way to create scoped containers in MEF. MEF 2 is getting there but not quite as easy as I'd like it to be for some scenarios. My Ideea was to add a third creating policy option: CreationPolicy.ScopeShared, that acts as Shared does but only at container level, any time a child container is created all the parts decorated with ScopeShared wll be recreated by the ChildContainer and will have their lifetime bound to the child container's lifetime. In my view this can greatly simplify a whole heap of scenarios: ( IE: containers are scoped per document )  and would be very easy to use, following current lifetime management pattern given by CreationPolicy. Catalin

  • Anonymous
    December 20, 2011
    Hello, I agree with the request for easy scoping. One more thing is that MEF bring the good of both extensibility and easy of development (and testing). In the easy of development it start to look like Google Guice and I think it will only be smart to mimic the good parts like scoping and factory pattern called AssistedInject. This can be done manually but will reduce boilerplate code if done inside the framework. Thanks for the great job. Ido

  • Anonymous
    January 05, 2012
    Is MAF still viable?

  • Anonymous
    January 09, 2012
    I tried to reference the dlls in my Silverlight project and it would not let me because it said they had not been compiled against the Silverlight Runtime

  • Anonymous
    January 21, 2012
    Thanks for great features in MEF 2. Why don't you publish MEF via NuGet?

  • Anonymous
    January 25, 2012
    Is there currently any support for MEF in the Windows 8 runtime?

  • Anonymous
    February 09, 2012
    The comment has been removed

  • Anonymous
    February 16, 2012
    I am looking for a simple wpf application built on mvvm pattern and use wep. I havent found any sample in the releases. And code i found on the internet are very complex as they contain many things. Can you put up a simple wpf application on mvvm using mef in next release samples. Thanks,