我正在使用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