Another The controller for path '/Admin/Plugin/ConfigureMiscPlugin' was not found or does not implement IController

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Hello,

I am trying to develop my first Nopcommerce plugin and I cannot figure out where I have gone wrong, I have looked at the two classes involved in creating a configuration page and they are both public.  I have cleaned the solution (confirmed content in both the plugin's folder and also the plugin bin folder has no content), rebuilt the solution, touched the global.asax file both whilst running the site through debug in VS and also with the site not running through debug in VS, rebooted the PC and deleted all content from both the Windows temp and my user profile temp folders and still I get the does not implement IController error.  Could anybody help as I am lost on what the cause is now.

** Controller **

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;

using Nop.Web.Framework.Controllers;

namespace Nop.Plugin.Website.Estimator.Controllers
{
    /// <summary>
    /// Controller for the plugin
    /// </summary>
    public class EstimatorPluginController : BasePluginController
    {
        [AdminAuthorize]
        public ActionResult Configure()
        {
            return View("~/Plugins/Website.Estimator/Views/Configure.cshtml");
        }
    }
}


** Plugin Interface **

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Routing;

using Nop.Core.Plugins;
using Nop.Services.Common;

namespace Nop.Plugin.Website.Estimator
{
    /// <summary>
    /// Implements IMiscPlugin interface
    /// </summary>
    public class EstimatorPlugin : BasePlugin, IMiscPlugin
    {
        /// <summary>
        /// Gets a route for provider configuration    
        /// </summary>
        /// <param name="actionName">Action name</param>
        /// <param name="controllerName">Controller name</param>
        /// <param name="routeValues">Route values</param>
        ///
        public void GetConfigurationRoute(out string actionName, out string controllerName, out RouteValueDictionary routeValues)
        {
            actionName = "Configure";
            controllerName = "EstimatorPluginController";
            routeValues = new RouteValueDictionary()
            {
                { "Namespaces", "Nop.Plugin.Website.Estimator.Controllers" },
                { "area", null }
            };
        }
    }
}


** The View **

https://ibb.co/bQrGow


@{
    Layout = "";
}
@using Nop.Web.Framework;
@using Nop.Plugin.Website.Estimator;

<div class="panel-group">
    <div class="panel panel-default">
        <div class="panel-body">
            <div class="col-md-12">
                <h1>Estimator Plugin</h1>
            </div>
        </div>
    </div>
</div>
}
6 years ago
Change controller name

controllerName = "EstimatorPluginController"; to controllerName = "EstimatorPlugin";

at GetConfigurationRoute method. Or put the bellow code


 public void GetConfigurationRoute(out string actionName, out string controllerName, out RouteValueDictionary routeValues)
        {
            actionName = "Configure";
            controllerName = "EstimatorPlugin";
            routeValues = new RouteValueDictionary()
            {
                { "Namespaces", "Nop.Plugin.Website.Estimator.Controllers" },
                { "area", null }
            };
        }
6 years ago
Update ==>


  public void GetConfigurationRoute(out string actionName, out string controllerName, out RouteValueDictionary routeValues)
        {
            actionName = "Configure";
            controllerName = "EstimatorPlugin;  // name without Controller
            routeValues = new RouteValueDictionary()
            {
                { "Namespaces", "Nop.Plugin.Website.Estimator.Controllers" },
                { "area", null }
            };
        }
6 years ago
Thanks very much for the correction, the configuration page is now working as it should.  I do have one question though how is my controller name EstimatorPlugin?  The class for the controller is EstimatorPluginController, the only place I can see a class with the name EstimatorPlugin is the same class I define the GetConfigurationRoute method in?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.