david
david

Reputation: 518

The controller for path '/Admin/Widget/ConfigureWidget' was not found or does not implement IController

I have a Nopcommerce 3.30 (with source code) project and I have configured my own Widget plugin. When I have install it and I'm trying to configure it in '../Admin/Widget/List', the following error Appears:

The controller for path '/Admin/Widget/ConfigureWidget' was not found or does not implement IController.

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.Web.HttpException: The controller for path '/Admin/Widget/ConfigureWidget' was not found or does not implement IController.

Source Error:

Line 12: @if (!String.IsNullOrEmpty(Model.ConfigurationActionName))
Line 13: {
Line 14:     @Html.Action(Model.ConfigurationActionName, Model.ConfigurationControllerName, Model.ConfigurationRouteValues);
Line 15: }
Line 16: else

Plugin controller:

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;
        }

This is my plugin class

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" };
        }

I don't understand what's the source of the error. Thanks

Upvotes: 1

Views: 1346

Answers (1)

david
david

Reputation: 518

I didn't realized that my controller was not public:

class WidgetsApplicationNotesController : BasePluginController

Upvotes: 2

Related Questions