У меня есть проект Nopcommerce 3.30 (с исходным кодом), и я настроил свой собственный плагин Widget. Когда я его установлю, и я пытаюсь настроить его в "../Admin/Widget/List", появляется следующее сообщение об ошибке:
Контроллер для пути '/Admin/Widget/ConfigureWidget' не найден или не реализует IController.
Описание: Необработанное исключение возникло во время выполнения текущего веб-запроса. Просмотрите трассировку стека для получения дополнительной информации об ошибке и ее возникновении в коде.
Сведения об исключении: System.Web.HttpException: Контроллер для пути '/Admin/Widget/ConfigureWidget' не найден или не реализует IController.
Ошибка источника:
Line 12: @if (!String.IsNullOrEmpty(Model.ConfigurationActionName))
Line 13: {
Line 14: @Html.Action(Model.ConfigurationActionName, Model.ConfigurationControllerName, Model.ConfigurationRouteValues);
Line 15: }
Line 16: else
Контроллер плагина:
using System.Web.Mvc;
using Nop.Core;
using Nop.Core.Caching;
using Nop.Plugin.Widgets.ApplicationNotes.Infrastructure.Cache;
using Nop.Plugin.Widgets.ApplicationNotes.Models;
using Nop.Services.Configuration;
using Nop.Services.Media;
using Nop.Services.Stores;
using Nop.Web.Framework.Controllers;
namespace Nop.Plugin.Widgets.ApplicationNotes.Controllers
{
class WidgetsApplicationNotesController : BasePluginController
{
private readonly IWorkContext _workContext;
private readonly IStoreContext _storeContext;
private readonly IStoreService _storeService;
private readonly IPictureService _pictureService;
private readonly ISettingService _settingService;
private readonly ICacheManager _cacheManager;
public WidgetsApplicationNotesController(IWorkContext workContext,
IStoreContext storeContext,
IStoreService storeService,
IPictureService pictureService,
ISettingService settingService,
ICacheManager cacheManager)
{
this._workContext = workContext;
this._storeContext = storeContext;
this._storeService = storeService;
this._pictureService = pictureService;
this._settingService = settingService;
this._cacheManager = cacheManager;
}
Это мой класс плагина
using Nop.Core;
using Nop.Core.Plugins;
using Nop.Services.Cms;
using Nop.Services.Configuration;
using Nop.Services.Localization;
using Nop.Services.Media;
using System.Collections.Generic;
using System.IO;
using System.Web.Routing;
namespace Nop.Plugin.Widgets.ApplicationNotes
{
public class ApplicationNotesPlugin: BasePlugin, IWidgetPlugin
{
private readonly IPictureService _pictureService;
private readonly ISettingService _settingService;
private readonly IWebHelper _webHelper;
public ApplicationNotesPlugin(IPictureService pictureService,
ISettingService settingService, IWebHelper webHelper)
{
this._pictureService = pictureService;
this._settingService = settingService;
this._webHelper = webHelper;
}
/// <summary>
/// Gets widget zones where this widget should be rendered
/// </summary>
/// <returns>Widget zones</returns>
public IList<string> GetWidgetZones()
{
return new List<string>() { "home_page_top" };
}
Я не понимаю, в чем причина ошибки. благодаря
Я не понял, что мой контроллер не был публичным:
class WidgetsApplicationNotesController : BasePluginController