Jun 11, 2009 at 2:04 AM
Edited Jun 11, 2009 at 2:20 AM
Okay here is my problem,.. I have a MVC application based upon code found here
I added a database and a repository and service project(s) which I need to use structure map to allow my plugins have access to the database uncoupled along with the main MVC application
If you would like to look at what I did check out
http://www.danswatik.com/ForumDB.Bak (SQLEXPRESS 2008 backup - Database is named Forum)
I followed the same structure that Rob Conery did with his store front like this :
http://weblogs.asp.net/shijuvarghese/archive/2008/10/10/asp-net-mvc-tip-dependency-injection-with-structuremap.aspx, only problem is the structuremapcontroller factory I couldn't do because I already have a controllerfactory that is doing the extensibility.
However I am meeting with little success I keep getting this
The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.
1) No exports were found that match the constraint '((exportDefinition.ContractName = "MvcWithMEF.Services.IForumService") && (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") && "MvcWithMEF.Services.IForumService".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'ForumExtension.Presentation.Controllers.ForumController..ctor (Parameter="forumService", ContractName="MvcWithMEF.Services.IForumService")' on part 'ForumExtension.Presentation.Controllers.ForumController'.
Element: ForumExtension.Presentation.Controllers.ForumController..ctor (Parameter="forumService", ContractName="MvcWithMEF.Services.IForumService") --> ForumExtension.Presentation.Controllers.ForumController --> TypeCatalog (Types="ForumExtension.Presentation.Controllers.ForumController")
Resulting in: Cannot get export 'ForumExtension.Presentation.Controllers.ForumController (ContractName="System.Web.Mvc.IController")' from part 'ForumExtension.Presentation.Controllers.ForumController'.
Element: ForumExtension.Presentation.Controllers.ForumController (ContractName="System.Web.Mvc.IController") --> ForumExtension.Presentation.Controllers.ForumController --> TypeCatalog (Types="ForumExtension.Presentation.Controllers.ForumController")
Anyhow what am I doing wrong?