C# 错误消息";没有为此对象定义无参数构造函数“;

C# 错误消息";没有为此对象定义无参数构造函数“;,c#,nopcommerce,C#,Nopcommerce,这段代码在nopcommerce 4.10中错误停止,这是因为,在以前的版本中没有问题(4.00) 完整代码: var plugins = Activator.CreateInstance(types.First()) as IPluginFinder; var types=typeFinder.FindClassesOfType(); if(types.Count()==1) { var plugins=Activator.CreateInstance(types.First())作为IPl

这段代码在nopcommerce 4.10中错误停止,这是因为,在以前的版本中没有问题(4.00)

完整代码:

var plugins = Activator.CreateInstance(types.First()) as IPluginFinder;
var types=typeFinder.FindClassesOfType();
if(types.Count()==1)
{
var plugins=Activator.CreateInstance(types.First())作为IPluginFinder;
var currentPlugin=plugins.getpluginderscriptorbysystemname(“misc.myplugin”);
if(currentPlugin==null | | currentPlugin.Installed==false)
返回;
}
错误: 没有为此对象定义无参数构造函数


在版本4.10中,
PluginFinder
类得到了一个新的构造函数,它需要一个类型为
IEventPublisher
的参数(请参阅)。您需要为该参数提供一个值。我不知道这个产品,但也许你会在发行说明或文档中找到一些关于它的信息

var types = typeFinder.FindClassesOfType<IPluginFinder>();

if (types.Count() == 1)
{
    var plugins = Activator.CreateInstance(types.First()) as IPluginFinder;
    var currentPlugin = plugins.GetPluginDescriptorBySystemName("misc.myplugin");
    if (currentPlugin == null || currentPlugin.Installed == false)
        return;
}

在版本4.10中,
PluginFinder
类得到了一个新的构造函数,它需要一个类型为
IEventPublisher
的参数(请参阅)。您需要为该参数提供一个值。我不知道这个产品,但也许你会在发行说明或文档中找到一些关于它的信息

var types = typeFinder.FindClassesOfType<IPluginFinder>();

if (types.Count() == 1)
{
    var plugins = Activator.CreateInstance(types.First()) as IPluginFinder;
    var currentPlugin = plugins.GetPluginDescriptorBySystemName("misc.myplugin");
    if (currentPlugin == null || currentPlugin.Installed == false)
        return;
}