New Plugin: Value cannot be null. Parameter name: serviceType

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

I'm trying to develop my first nopCommerce plugin.
When I click "install" in the shop administration all I get is an error message:

Value cannot be null. Parameter name: serviceType

Any ideas on how I find the source of the problem?
12 years ago
Seems like I was missing BasePlugin class.
12 years ago
I'm inheriting from BasePlugin class, but still encountering this message with Install.  Can you be more specific or provide working example?
12 years ago
Are you inheriting from one of the base interfaces as well?
My plugin declaration ended up looking like this.
I think is was the "IMiscPlugin" in line 3 that did it.


namespace Nop.Plugin.Other.ClosingTest {

  public class ClosingTestPlugin : BasePlugin, IMiscPlugin {
    private readonly ClosingTestObjectContext _context;

    public ClosingTestPlugin(ClosingTestObjectContext context) {
      _context = context;
    }

    public override void Install() {
      _context.Install();
      base.Install();
    }

    public override void Uninstall() {
      _context.Uninstall();
      base.Uninstall();
    }

}
}
8 years ago
I got exactly same error while I was developing my own plugin.

The root cause of error was that I forgot to add "Autofac" reference, which is located at \packages\Autofac.3.5.2\lib\net40\Autofac.dll

Also you may want to check the classes and methods are "public".
8 years ago
yes it chould be autofac issue make sure you have added reference of it with same property that is on other plugin on which autofac is referenced.


so refer the other MiscPlugin and add required reference and set the reference property in same manner
7 years ago
This same error happened to me but the reason was because the Type property PluginDescriptor.PluginType wasn't being set.  The reason it wasn't being set is because I accidentally put my BasePlugin, IMiscPlugin implementation in another plugin with a different namespace.
7 years ago
For my case i need to implements BasePlugin and IMiscPlugin:

using System.Web.Routing;
using Nop.Core.Plugins;
using Nop.Services.Common;

namespace Nop.Plugin.Misc.HelloWorld
{
    public class HelloWorldPlugin : BasePlugin, IMiscPlugin
    {
        public void GetConfigurationRoute(out string actionName, out string controllerName, out RouteValueDictionary routeValues)
        {
            actionName = "Configure";
            controllerName = "HelloWorld";
            routeValues = new RouteValueDictionary()
            {
                { "Namespaces", "Nop.Plugin.Misc.HelloWorld.Controllers" },
                { "area", null }
            };

        }
    }
}
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.