This project has moved and is read-only. For the latest updates, please go here.

Using MEF with ASP.NET MVC 3 Sample Code

Rating:        Based on 3 ratings
Reviewed:  2 reviews
Downloads: 5752
Released: Nov 11, 2011
Updated: Nov 11, 2011 by nblumhardt
Dev status: Alpha Help Icon

Recommended Download

Example Sample Application
example, 614K, uploaded Nov 11, 2011 - 5752 downloads

Release Notes

This sample application demonstrates the Composition Provider for ASP.NET MVC 3 included in MEF 2.

  • Visual Studio 2010
  • ASP.NET MVC 3 (installed, with developer tools)
  • SQL Server Express (included with Visual Studio)

Important: before the sample can be run, the Entity Framework 4.1 NuGet package needs to be installed into the solution. There are two ways to do this:
  • In Visual Studio: right-click on the FabrikamBooks project, select "Add Library Package Reference", search for "EntityFramework" and install the Entity Framework 4.1 package by Microsoft; or,
  • Using the nuget.exe command line tool: open a command prompt in the \packages folder, execute the command
    • nuget install ..\FabrikamBooks\packages.config

Reviews for this release

This example requires MVC3, and will not run under MVC4. It would be nice to amend it to run under MVC4.
by fins2thright on Aug 1, 2012 at 3:22 PM
Works on MVC 3 not 5!
by babakhoo on Aug 19, 2014 at 12:19 PM