Prise icon indicating copy to clipboard operation
Prise copied to clipboard

DI With Blazor components

Open rfriend-zilo opened this issue 1 year ago • 0 comments

To get routing to work with blazor server side - I have to add the loaded plugin assemblies to the router

<Router AppAssembly="@typeof(App).Assembly" AdditionalAssemblies="@_pluginAssemblies">

This then seems to render the loaded plugins fine, until I try to inject plugin services - I can inject things I declare directly in the host (such as config services, etc), but I cannot inject services I've created and set up in the plugin (using bootstrapper and PluginService, etc), it seems to tie the assembly to the host IServiceProvider.

Additionally, I noticed the MvcPluginLoader does not fire the activated method, so i did this manually using IPluginActivator.

rfriend-zilo avatar Mar 14 '23 09:03 rfriend-zilo