Help with custom Shipping plugin controller

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 12 años
Hi all and merry xmas ;)

I'm writing a shipping provider plugin, ShippingByWeightProvince, which I'm planning to release for the community once it's finished.

Although I've made 3 o 4 plugins in the past, I can't get this one working. Specifically, I can't reach the controller inside the plugin. Using nop 2.20, I get a 404 if I type the route in the address bar (using route debugger and I can see it's matched), and of course the famous 'the controller path for XXXX doesn't implement IController' when trying to configure the shipping method inside Admin.

The controller derives from System.Web.Mvc.Controller, my DataContext is created OK but... can someone point me to the right direction?

Just for your info, here's the route provider:


public void RegisterRoutes(RouteCollection routes)
        {
            routes.MapRoute("Plugin.Shipping.ByWeightProvince.DefaultRoute",
                 "Plugins/ShippingByWeightProvince/{action}",
                 new { controller = "ShippingByWeightProvince", action = "Configure" },
                 new[] { "CallCentrix.Plugin.Shipping.ByWeightProvince.Controllers" }
            );
        }


Here's my controller signature:

[AdminAuthorize]
    public class ShippingByWeightProvinceController: Controller
    {
....


Here's my GetConfigurationRoute method in the ByWeightProvinceShippingComputationMethod class (plugin)

public void GetConfigurationRoute(out string actionName, out string controllerName, out RouteValueDictionary routeValues)
        {
            actionName = "Configure";
            controllerName = "ShippingByWeightProvince";
            routeValues = new RouteValueDictionary() { { "Namespaces", "CallCentrix.Plugin.Shipping.ByWeightProvince.Controllers" }, { "area", null } };
        }


Of course the plugin is installed, it shows in the available shipping methods, it creates its DbContext upon installation...

Any ideas how to debug this? :)

Thanks, best regards!
Hace 12 años
Solved, had to delete everything on

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\

and

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\

And reload.

It's funny that 'touching' web.config worked for me in the past when updating plugins...
Hace 12 años
cdelaorden wrote:
It's funny that 'touching' web.config worked for me in the past when updating plugins...

It's also recommend "touching" global.asax file
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.