Sunday, August 24, 2014

Intro to MEF - Part 4: Method Exports

In Part 4 of my series Intro to MEF we take a look at the basics of method exports.

Intro to MEF - Part 3

Just finished part 3 in my series on Intro to MEF. In this episode we take a quick look at Property Exports. You can watch on YouTube.

Monday, May 26, 2014

WCF Gotchas: Connection Closed

Here is a quick video explaining 3 WCF gotchas which result in the same error message: the connection has been closed.

Sunday, October 6, 2013

How CallerMemberNameAttribute can help to remove magic strings

In this short video we explore how using extension methods and the CallerMemberNameAttribute can help to reduce duplicate code and remove magic strings from your code

Tuesday, August 13, 2013

Intro to MEF - Part 2

This is a short video Intro to MEF - Part 2 in which we examine the basics of using and AssemblyCatalog.

Friday, June 21, 2013

C# Gotcha: Deferred Execution & Method Groups


Here is a short video demonstrating a C# Gotcha when it comes to using Deferred Execution with Method Groups:

Friday, January 11, 2013

An Intro to MEF – Part 1


I’m a big fan of MEF (Managed Extensibility Framework). I think it is very easy to use and offers a lot of advantages when developing an application.  MEF was developed to be a framework to allow for extensibility in your applications.  Parts of Visual Studio (including the Entity Framework Designer) run on MEF as does the Extension Manager.  That being said, it also works very well as a Dependency Injection container. My goal is not to compare MEF to other containers (ie. Unity, Windsor Castle, NInject, etc) but to show you how to use MEF as a DI container.

As usual, you can view/download the code on GitHub.

For Part 1 we will create a simple console application that will log a message.  However, we will use MEF as a DI container to supply the ILogger implementation.  Remember, this is meant to be a very simple example.  It is definitely not meant to demonstrate how MEF should be used.