mef

MEF & separate Interface assembly leads to "Interface for every class"

I'm getting my feet wet with DI/IoC and MEF in particular. I have a web application that has two types of parts (maybe more someday) defined by interfaces which need access to the whole environment. The application has a list with concrete implementations for each type, composed by MEF. The environment consists of: several repositori...

Expose WCF in mef plugin with Asp.net MVC

Hi, I would like to implement the next scenarion: ASP.Net MVC working with MEF in a similar manner as described by hammet. One of the things i need to allow, is the MEF Plugin contains a WCF service (or asmx service - backwords comptability). What approach can i use - if any - to make the MVC website grab the webservice and expose i...

Silverlight MVVM MEF ViewInjection

Hi all, since my title is buzzword compliant I hope I will get lots of answers to my question or any pointers to the right direction. OK what I usually do is have a ViewModel which contains a list of ViewModels itself. public class MasterViewModel { public ObservableCollection<DetailViewModel> DetailViewModels { get; set; } pub...

Using MEF with exporting project that uses resources (xml) contained in the xap.

I'm doing a proof of concept app in SL4 using MEF and as part of the app I am importing another xap from an existing Silverlight Project and displaying it in my host project. The problem is that the existing app uses some .xml files (as content) and it uses linq2xml to load these files which are (assumed to be) bundled in the xap. When...

how to inject a logger instance using MEF?

Hi, Is it possible to inject an instance of logger class object using Managed Extensibility Framework. Please show a sample code snippet. Thanks in advance ...

how to inject logger instance to every class that has a property of type ILogger using MEF

Hi, Is it possible to inject an instance of the logger to every class that has a property of type ILogger using MEF. Is there any other solution that composing each class type indvidually. I tried looking up Batch composition but looks very tedious to me as every class that needs the logger instance needs to be composed in a batch. Is th...

Considerations when architecting an extensible application using MEF

I've begun experimenting with dependency injection (in particular, MEF) for one of my projects, which has a number of different extensibility points. I'm starting to get a feel for what I can do with MEF, but I'd like to hear from others who have more experience with the technology. A few specific cases: My main use case at the momen...

Ninject and Custom Controller Factory

I'm using MEF with ASP.NET MVC as demonstrated at http://blog.maartenballiauw.be/post/2009/06/17/Revised-ASPNET-MVC-and-the-Managed-Extensibility-Framework-(MEF).aspx. When I try to use Ninject, it seems that nothing gets injected. I did some debugging, and when I reverted to the original controller factory the injection worked. What n...

MEF + SL4 question

I'm working on an app in the Silverlight 4 RC and i'm taking the oppertunity to learn MEF for handling plugin controls. I've got it working in a pretty basic manor, but it's not exactly tidy and I know there is a better way of importing multiple xap's. Essentially, in the App.xaml of my host app, I've got the following telling MEF to lo...

Accessing the project system from a Visual Studio MEF Editor extension

I'm writing a Visual Studio editor extension using the VS 2010 SDK RC. I'd like to be able to figure out what the references of the current project are. How do I get access to the project corresponding to the current editor? The documentation on editor extensions doesn't seem to include information on how to access non-editor parts of...

Configuring IoC container from modules/plug-ins ?

Hi guys, i am in big dilema.. I am working on highly modular web app in ASP.NET MVC 2 (in fact, core will be super lightweight, all work on modules/plugins). I found MEF pretty useful for modules discovery, but i dont want to us it as IoC container. There is pretty good chance that I will need advanced features of "true" IoC container, s...

Refactoring multiple interfaces to a common interface using MVVM, MEF and Silverlight4

I am just learning MVVM with MEF and already see the benefits but I am a little confused about some implementation details. The app I am building has several Models that do the same with with different entities (WCF RIA Services exposing a Entity framework object) and I would like to avoid implementing a similar interface/model for each...

.Net MEF newbie question

I am missing something basic when it comes to using MEF. I got it working using samples and a simple console app where everything is in the same assembly. Then I put some imports and exports in a separate project which contains various entities. I want to use these entities in an MS Test, but the composition is never actually done. When ...

How do I export and import application services with say MEF?

I'm working with MEF right now, but the answer I'm looking for probably is irrelevant to MEF -- it's all dependency injection -- I'm just using MEF terminology as an example here. Short background story, I read this article over at MSDN with focus on Composite Applications In this figure there's three things, the shell, the application...

Decoupling the view, presentation and ASP.NET Web Forms

I have an ASP.NET Web Forms page which the presenter needs to populate with controls. This interaction is somewhat sensitive to the page-life cycle and I was wondering if there's a trick to it, that I don't know about. I wanna be practical about the whole thing but not compromise testability. Currently I have this: public interface IS...

MEF: what is the role, lifetime and knowledge of the 'container'?

Hi, i'm playing with MEF and in the example i see this code ( i call it the MEF compose code): var catalog = new AssemblyCatalog(System.Reflection.Assembly.GetExecutingAssembly()); var container = new CompositionContainer(catalog); container.ComposeParts(); In most examples this is done in the same cource file as the Startup Program ...

UI Design Choices and How to Implement Them

I am making an application that is a dashboard/widget host. This is an app I will release online to kickstart a content based website I am making. I am using MEF to load the plugins and I have a ui Concept Idea like this: http://i42.tinypic.com/scb6nd.png Is this a good design choice? How would I implement the Navigation? 3. Is there ...

WCSF vs MEF, What's Best For Me?

Hey fellows, I'm working on a large web application that includes many modules (CRM, Inventory, Administration, etc.) What I want to accomplish is to be able develop each of these modules independently (the UI, Core Logic, DataAccess Logic, and all) and then integrate them all together into a core module (this integration should only ...

MEF + Plug-In not updating

I asked this on the MEF Codeplex forum already, but I haven't gotten a response yet, so I figured I'd try StackOverflow. Here's the original post if anyone's interested (this is just a copy from it): MEF Codeplex "Let me first say that I'm completely new to MEF (just discovered it today) and am very happy with it so far. However, I'v...

Loading 2 versions of the same plugin with Silverlight / MEF

My scenario is a classic MEF scenario. There is a silverlight host app, and the app can download plugins on the fly to add functionality. Plug ins can be created by third parties. Now the problem arises when different plugins and/or the host app reference different versions of the same assembly. For example: -plugin A references the v...