It is possible to load a RCL (Razor Component Library) to Blazor WebAssembly dynamically?
I found this Loading an external .NET Standard 2.0 assembly with blazor to load a standard classes
What I want is to develop a pluggable/extensible visual framework, where putting a dll in a ASP.NET Core Server folder where enought to access to that blazor component
Solution config:
Steps:
I finally develop a solution I want to share with you. A Module Manager witch allows you to load any outside component dynamically
Check it out here:
https://github.com/elgransan/BlazorPluginComponents
Some example code
var componentPackage = "RazorClassLibrary2";
var component = "Component2";
var stream = await Http.GetStreamAsync($"{MyNavigationManager.BaseUri}/{componentPackage}/{componentPackage}.dll");
var assembly = AssemblyLoadContext.Default.LoadFromStream(stream);
componentType = assembly.GetType(componentPackage + "." + component);
await DOMinterop.IncludeLink(componentPackage, $"/{componentPackage}/{componentPackage}.styles.css");
Where the files are in the server