Blazor Plugins #11463
Labels
area-blazor
Includes: Blazor, Razor Components
enhancement
This issue represents an ask for new feature or an enhancement to an existing one
✔️ Resolution: Duplicate
Resolved as a duplicate of another issue
Milestone
Is your feature request related to a problem? Please describe.
I have been experimenting with loading plugins dynamically into a blazor client app.
Few reasons for this experiment:
I've thrown together a quick POC here with a readme with a few screenshots https://github.com/dazinator/BlazorPlugins
It dynamically loads the plugin from the server when you click the button, and the plugin adds an item to the menu called "weather".
However there are a couple of problem areas I have hit in Blazor that prevent this from being a success endeavour, one which I believe I can work around and another which is a blocker:
I can't see a way to unload a plugin assembly, and netstandard2.0 doesn't let me work with the full power of AppDomains i.e no CreateInstanceAndUnwrap() or any of that good old stuff. I beleive I can workaround this problem area though.. when a user enable or disables a plugin, they will have to trigger a reload of the entire app (i.e full page refresh) at which point the shell will load from scratch, but this time only load up the newly approved list of plugins during startup.
Blocker: the plugin assembly that I am loading dynamically, includes a Blazor component with the /page directive. However the Router never sees that route (because the router only looks at assemblies referenced from the main assembly) and I am not sure how I can register this assembly with the router.
Describe the solution you'd like
I'd like to see a way to register dynamically loaded assemblies with blazor so that pages and components can be picked up from them. Similar to how we can achieve this with ApplicationParts in MVC.
The text was updated successfully, but these errors were encountered: