Home > Forum > Plugins > How to use abstract plugin / plugin config from another project?

How to use abstract plugin / plugin config from another project?
0

Hello,

I am in the process of standardizing our plugin packages. I would like to put all plugins on a common basis in order to be able to reuse functions such as custom logging methods in each plugin package without copying source code.

I have often used nested plugin and configuration classes within a plugin package project. This works without any problems.


Example:

*** shared project / solution ***

Base plugin class:
public abstract class MyCustomActionBase<TConfig> : CustomAction<TConfig> where TConfig: MyCustomActionConfigBase, new()
{
public override Task RunAsync(RunCustomActionParams args)
{
/* initialize own logger object... */

/* run action */
return MyRunAsync(args);
}

public abstract Task MyRunAsync(RunCustomActionParams args);
}

Base config class:
public abstract class MyCustomActionConfigBase : PluginConfiguration
{
[ConfigEditableText(DisplayName = "BaseConfigValue")]
public string BaseConfigValue { get; set; }
}


*** extending / 'productive' project / solution ***

Custom plugin class:
public class MyCustomAction : MyCustomActionBase<MyCustomActionConfig>
{
public override Task MyRunAsync(RunCustomActionParams args)
{
/* do something... */

return Task.CompletedTask;
}
}

Custom config class:
public class MyCustomActionConfig : MyCustomActionConfigBase
{
[ConfigEditableText(DisplayName = "ConfigValue")]
public string ConfigValue { get; set; }
}


Result:
The plugin itself is executed correctly, but the Designer Studio seems to have a problem loading the configuration class correctly. Only the configuration field from the 'MyCustomActionConfig' class is displayed, but not the configuration field from the 'MyCustomActionConfigBase' class. If the plugin/config classes and the base classes are in the same project, the problem does not occur.

Can anyone give me a hint as to what I am doing wrong? Or is this a problem with WEBCON itself?

Tank you!
Marco

Nobody has replied in this thread yet.