我正在使用nop商务。为此对象定义的无参数构造函数-nop commerce 2.6
我向Catalog Controller添加一个新的服务类。
然后它得到这个错误。
No parameterless constructor defined for this object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.MissingMethodException: No parameterless constructor defined for this object.
Source Error:
Line 3: @foreach (var widget in Model)
Line 4: {
Line 5: @Html.Action(widget.ActionName, widget.ControllerName, widget.RouteValues)
Line 6: }
Source File: f:\project\sitename\Presentation\Nop.Web\Views\Widget\WidgetsByZone.cshtml Line: 5
我改变了这个控制器。
public CatalogController(ICategoryService categoryService,
IManufacturerService manufacturerService)
到
public CatalogController(ICategoryService categoryService,
IManufacturerService manufacturerService, IbookService bookService)
,它已收到错误。
如何解决?
这看起来就像您未注册IProductService接口时会遇到的那种错误。你是否正确地注册了你的类型? – Carth 2014-09-04 02:58:42