I have looked at the MVC-ControllerTypeCache.XML and no matter what I do including the application restart I still cannot see my controller registered there.
I end up with the following error when I try to configure the plugin. The plugin installs without any problems though
The controller for path '/Admin/Plugin/ConfigureMiscPlugin' was not found or does not implement IController.
Here is my code any help would be much appreciated
namespace Nop.Plugin.Misc.StoreLocator
{
public partial class RouteProvider : IRouteProvider
{
public void RegisterRoutes(RouteCollection routes)
{
routes.MapRoute("Plugin.Misc.StoreLocator.Configure",
"Plugins/MiscStoreLocator/Configure",
new { controller = "MiscStoreLocator", action = "Configure" },
new[] { "Nop.Plugin.Misc.StoreLocator.Controllers" }
);
}
public int Priority
{
get
{
return 0;
}
}
}
}
namespace Nop.Plugin.Misc.StoreLocator
{
public class StoreLocatorPlugin : BasePlugin, IMiscPlugin
{
/// <summary>
/// Gets a route for plugin 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 = "MiscStoreLocator";
routeValues = new RouteValueDictionary { { "Namespaces", "Nop.Plugin.Misc.StoreLocator.Controllers" }, { "area", null } };
}
}
namespace Nop.Plugin.Misc.StoreLocator.Controllers
{
public class MiscStoreLocatorController: Controller
{
private readonly ISettingService _settingService;
private readonly ILocalizationService _localizationService;
public MiscStoreLocatorController(ISettingService settingService,
ILocalizationService localizationService)
{
this._settingService = settingService;
this._localizationService = localizationService;
}
[AdminAuthorize]
[ChildActionOnly]
public ActionResult Configure()
{
var model = new ConfigurationModel();
return View("Nop.Plugin.Misc.StoreLocator.Views.MiscStoreLocator.Configure", model);
}
}
}
@{
Layout = "";
}
@model ConfigurationModel
@using Nop.Plugin.Misc.StoreLocator.Models;
@using Nop.Web.Framework;
@using (Html.BeginForm())
{
<table class="adminContent">
<tr>
<td colspan="2">
<b>@T("Plugins.Misc.StoreLocator.Notes")</b>
</td>
</tr>
<tr>
<td class="adminTitle">
@Html.LabelFor(m => m.ApiKey):
</td>
<td class="adminData">
@Html.EditorFor(m => m.ApiKey)
@Html.ValidationMessageFor(m => m.ApiKey)
</td>
</tr>
<tr>
<td colspan="2" width="100%">
<button type="submit" name="save" value="save" class="t-button">
@T("Admin.Common.Save")</button>
</td>
</tr>
</table>
}