mef

Windows Service Container

For my projects I need quite often to create windows services. I need them for scheduling operations, file system watching, asynchronous or long running side tasks (backup files, sending messages, check incoming mail to process, notifications etc). I also use them to expose WCF services that are cross applications in the enterprise....

MEF vs Mono.AddIn

Hi, I'm developing a .NET 3.5 C# desktop application. It should be extensible via plug-ins. Are there any articles etc. discussing the differences between MEF and Mono.AddIn to help me make an informed decision? Or even better have you got experience with both of these frameworks and can comment on them? Thanks, Patrick ...

MEF vs. PRISM. What is the difference? What will be supported in the future?

I have read similiar posts but I it not clear to me. What I want to create is a Silverlight apps with a few tabs/modules that will all be seperate DLLs. I see PRISM has the Shell/Module concepts that seem directed towards doing UI and I find a nice demo (showing how to search digg/twitter). But It sounds like MEF will be included i...

Customised business rules per customer...(asp.net mvc)

In a web application i'm working on, items can pass through multiple states (eg. workflow) and after each workflow a rule can be run after each step which can stop the process or display additional messages. How should these rules be defined? I was thinking about a dll per rule (and hooking them up either with MEF or events) but one a...

Does MEF Support Customized CTOR?

It looks like that MEF framework creates objects which have default CTOR. How about customized CTOR, or Constructor with parameters? For example: [Export (typeof(IInterface1))] public class MyClass : IInterface1 { public MyClass(int id) {....} .... } If not, one way I can think is to pass object as parameters to CTOR. For exam...

Extensibility via Mono.Addins or MEF

I have some experience with Mono.Addins, the extensibility framework heavily used in the Mono project. I am aware that Microsoft has recently developed their own extensibility framework by the name of MEF, as well as released it as open source. I am wondering if it is worthwhile to use this extensibility framework. If someone familiar wi...

System.Security.SecurityException when creating a new FileStream

I have a regular .NET application. In this case I have a part that's being imported by MEF. It imports fine, but at a certain point, I want to save a List of objects to a file. In this case it's just saving a list of high scores: class HighScores { static HighScores() { CheckTrust(); } [ImportingConstructor] ...

When is MEF shipping?

I'm building a product that will ship after .Net 4.0 is released. Is MEF an integral part of .Net 4.0, so I can count on them being released together, or is it some external component that might be released separately and thus it is dangerous to use? ...

Basic MEF workflow/usage

I'm looking to a framework which will allow me to have a simple plugin system in my .NET application. It seems MEF is the framework which Microsoft is endorsing, and will become part of .NET 4 (it also seems to work with older .NET versions as a separate library, as well as Mono). I'm previously used Mono.Addins as for a plugin system f...

How-To Prevent Module Duplicates with MEF ?

Hi, How can i prevent from MEF to load duplicates Modules in the case of the presence of 2 copies of the same Assembly (maybe by mistake) Assembly1.dll Assembly2.dll (copy of Assembly1) [ImportMany] public IList<IModule> Modules { get; private set; } public void BuildUp() { Modules = new List<IModule>(); var catalog = new Dir...

Instruct MEF to use any available assemblies

I am trying out the Managed Extensibility Framework for the first time in Visual Studio 2010 beta 2 using the System.ComponentModel.Composition from .net-4.0. I have been unable to get the CompositionContainer to find my implementation assemblies using the two alternative routines below. First attempt (this worked in an older codeplex ...

How does MEF determine the order of its imports?

MEF allows you to import multiple parts via the use of the ImportMany attribute. How does it determine the order in which it retrieves the relevant exports and adds them to the enumerable you are populating? For example, how would I import multiple IRules that had to fire in a particular order? The only way I can think of is to have an O...

Books on Unity or MEF

Anyone know if there are any books on Unity or MEF coming out in the next month or two? ...

VS 2010 mouse processor extension - not working

I am experimenting with a Visual Studio 2010 extension, where I need to work with the events exposed by IMouseProcessor. As far as I can tell from the docs, I should create an IMouseProcessorProvider and export is using MEF, so that it can be automatically picked up by Visual Studio. I created this class: [Export(typeof(IMouseProcess...

Is it safe to store an ObjectContext in a thread static variable in ASP.NET?

I've read that I should store an ObjectContext in HttpContext.Current in order to share my ObjectContext across different services/repositories that are called in a request. I'm wondering if it is safe to use an ObjectContext with the [ThreadStatic] attribute on a static class variable instead. Is that a safe thing to do? Is each request...

Import property always null (MEF import issue)

Hi, I try for some time to get things done using MEF but now, I run into a problem i need help. Description: I have 2 DLL and one EXE file. ClassLibrary1 (LoggerImpl.cs, SomeClass.cs) ClassLibrary2 (ILogger.cs) WindowsApplicationForms1 (WindowsApplicaitonForms1.cs, Program.cs) I need any help or direction why this doesn't work ? // C...

MEF: Where should I put the CompositionContainer?

Hello Everyone, I have been using the Windsor IoC Container for my web-based application, to resolve the data access layer implementation the application should use. The web application's UI will consist of pages, and each page consists of small units called portlets. (Their concept is somewhat similar to widgets.) These so-called port...

MEF: What if I have multiple exports but need only one import?

Hello Everyone, I'm trying to wrap my mind around MEF. There is one thing I don't understand. Assume that I have an interface, named ISomething, which is a contract, and I have more than one assemblies in a folder that contains my application, and I have no idea how many ISomething implementations are in them, or which one contains one...

Sandboxing plugins with Managed Extensibility Framework

I'm working on an application where third party developers will be able to write plugins. I've been looking a little at Managed Extensibility Framework and it seems the right way to go. One thing though, I want to prevent plugins from accessing the rest of the application freely (calling singletons etc) but would want to restrict to to ...

MEF + WCF Service Host?

I am just getting into MEF and I have come across a problem that I cannot resolve. I have a windows service that is reading in my DLLs (via MEF) and each DLL is a WCF Service Host. When I run my windows service and read in the DLLs everything runs fine, except that whenever one of the WCF DLLs get any "activity" then they reinstantiate a...