mef

MEF 'The export is not assignable to type' error

I have just started using MEF and have hit on an early problem. I have an interface called DataService: namespace DataAccess { interface IDataService { string Name { get; } string Description { get;} List<String> GetPeople(); } } There are 2 implementations of this interface, one for SQL Server and one for Oracle. ...

MEF: load a plugin from a different plugin

Is it possible to load a plugin from a another different plugin ...

MEF metadata dictionary from object

Hi, I would like to manually create exports for composition, but the Export constructor only accepts a dictionary for metadata, while I should directly create it from the metadata object (IMyMetadata). Isn't there a way to create the dictionary from the object? Something like this: IDictionary<string, object> metadata = AttributedModel...

MEF - Showing View from other View

I'm learning MEF and have some problems with understanding it. I have small project with MainWindow and some assemblies which are loaded into catalog. One of the assemblies need to show a view from other assembly, once at a start and later, if I click the button. Here is the head part of this view: [Export("OperatingPlugin", typeof(Use...

Using Configuration Manager.GetSection with Configuration Manager.OpenExe...

I have an executable that consumes DLL’s through MEF. I am successfully loading each DLL’s config file's appsettings keys using var appConfig = ConfigurationManager.OpenExeConfiguration(Assembly.GetExecutingAssembly().Location); return appConfig.AppSettings.Settings["Version"].Value; Now I want to make it so the DLL allo...

The best way to import a collection of values in a controller using MEF

I have an ASP.NET MVC2 application that supports visualization plug-ins/providers. The IVisualization interface is defined in a common assembly which is referenced by both the ASP.NET MVC2 app, and any visualization providers. In the Visualization controller, I have a method which returns all the applicable visualizations for a given se...

MEF: Component authentication

I am building a Windows (Service) application that, in short, consists of a "bootstrapper" and an "engine" (an object loaded by the bootstrapper, which transfers control to it, and then performs the actual tasks of the application). The bootstrapper is a very basic startup routine that has few features that are likely to change. But the ...

Proper way to expose third party visual control in MEF

What is the proper way to do that? Let's say we have some third party library in our project and we need to provide an access to some controls which are sealed. New widgets will be created and added to the application using MEF and they should be able to import some controls from the core application. So how to export those controls prop...

MEF: "Unable to load one or more of the requested types. Retrieve the LoaderExceptions for more information".

Scenario: I am using Managed Extensibility Framework to load plugins (exports) at runtime based on an interface contract defined in a separate dll. In my Visual Studio solution, I have 3 different projects: The host application, a class library (defining the interface - "IPlugin") and another class library implementing the interface (the...

New Prism Project - Use MEF or Unity?

I'm starting a new personal Prism 4 project. The Reference Implementation currently uses Unity. I'd like to know if I should use MEF instead, or just keep to Unity. I know a few discussions have mentioned that these two are different, and they do overlap, but will I be missing out if I simply choose Unity all the way? ...

MEF field imports not being resolved

I have MEF/Prism 4 project for which I can resolve imports via the ImportingConstructor, but not via field imports in the same class. In the sample code below, myDataService is correctly resolved in the constructor. But _myDataServiceFieldImport isn't resolved, despite the Import attribute. Same result whether it's a field or proper...

Who owns the ViewModel in an MEF application

I am designing an application (Silverllight or WPF, still debating) but I am stuck at a design issue and was if wondering you could provide your opinion on it.... Here's the scenario. This is an Employee management application for HR. Once the application is ready, HR may ask for more features to be added(which most of the time means, m...

Can you load a XAP from a byte array in Silverlight 4.0

I know that MEF currently supports downloading XAP files from a URI (which is awesome!), but does anyone know if it's possible to have MEF load a XAP from a byte array? Thanks! ...

Java equivalent for MEF in .NET

Hi, Does the Netbeans Rich-Client Platform Development provide the same in Java as MEF in .NET? Is there is any other built-in easy way in JAVA to do pluggable applications? Thanks ...

MEF and moonlight

Hello, I am trying to figure out if MEF and moonlight work together. I heard Mono 2.8 got MEF already included. Although, will the full MEF work for moonlight applications? For now I am using this adapted moonlight library http://mefcontrib.codeplex.com/releases/view/35019. Although, some functionality is stripped or this library is...