【发布时间】:2009-12-22 12:55:14
【问题描述】:
我收到一个错误:
结构图异常代码:202 没有为 PluginFamily MVCPoco.Services.IService、MVCPoco.Services、Version=1.0.0.0、Culture=neutral、PublicKeyToken=null 定义默认实例
Line 96: {
Line 97: Type controllerType = base.GetControllerType(context, controllerName);
Line 98: return ObjectFactory.GetInstance(controllerType) as IController;
Line 99: }
Line 100: }
错误发生在第 98 行
有什么想法吗? 我正在使用 Visual Studio 2010 附带的 asp.net mvc 2 preview 2。
【问题讨论】:
-
private static void InitializeStructureMap(IInitializationExpression x) { x.Scan(y => { y.Assembly("MVCPoco.Core"); y.Assembly("MVCPoco.Data"); y.With
(); });我正在使用该代码来使用默认名称约定......也许我做错了什么。 -
我正在使用 SM 2.5.2 这些方法在我当前的上下文中不存在 x.For
().Use (); y.With(new SingleImplementationScanner());
标签: c# asp.net-mvc structuremap ioc-container