Skip to content
Discussion options

You must be logged in to vote

I found a very dirty solution, it is just working.

So I changed the plugin as below:

public class MyPlugin
{
    private readonly IFileManager _fileManager;
    public ExcelPlugin(IServiceProvider serviceProvider)
    {   
         _fileManager = serviceProvider.GetService<IFileManager>()!;
    }
}

And finally the way which I create the Native Plugin:

// Create native plugin collection
builder.Services.AddTransient((serviceProvider) =>
{
     KernelPluginCollection pluginCollection = [];
     pluginCollection.AddFromObject<MyPlugin>(new MyPlugin(serviceProvider),"MyPlugin");

     return pluginCollection;
});

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sophialagerkranspandey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant