Click here to Skip to main content
12,503,591 members (51,226 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

5.7K views
2 bookmarked
Posted

Solving "The IControllerFactory 'MefContrib.Web.Mvc.CompositionControllerFactory' did not return a controller for the name xxx"

, 30 Jul 2014 CPOL
Rate this:
Please Sign up or sign in to vote.
Solving "The IControllerFactory 'MefContrib.Web.Mvc.CompositionControllerFactory' did not return a controller for the name xxx"

Solution

if you have this

public virtual ViewResult Index(IService service)
{
    return View();
}

1) Make sure that the class that implements IService is decorated with the Export attribute:

[Export(typeof(IService)), PartCreationPolicy(CreationPolicy.NonShared)]
    public class ServiceImplementation : IService
    {}

2) Make sure there is no other class exporting the same contract:

[Export(typeof(IService)), PartCreationPolicy(CreationPolicy.NonShared)]
    public class AnotherServiceImplementation : IAnotherService
    {}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Omar Gameel Salem
Software Developer
Australia Australia
Enthusiastic programmer/researcher, passionate to learn new technologies, interested in problem solving, data structures, algorithms, AI, machine learning and nlp.

Amateur guitarist/ keyboardist, squash player.

You may also be interested in...

Pro
Pro

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160919.1 | Last Updated 30 Jul 2014
Article Copyright 2014 by Omar Gameel Salem
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid