user2109347
user2109347

Reputation: 69

Render a page at run time from dynamically loaded assembly in Blazor app

I am creating a modular Blazor app, which dynamically loads all the external assemblies (i.e. modules) from a location.

Then I want to show module names in NavMenu of the Blazor app.

When user clicks on a module name, then browser renders a page/component from that module with in Index page of my Blazor app.

Need help in doing that

Upvotes: 6

Views: 3984

Answers (2)

agua from mars
agua from mars

Reputation: 17444

Lazy loading assemblies is not yet available for blazor. All assemblies your project depends on will be loaded on start.
This feature should be implemented in .Net 5 Release https://github.com/aspnet/AspNetCore/issues/5465

Update Blazor 5 Preview

Mike S. comments with the doc url to the Lazy load assemblies in ASP.NET Core Blazor WebAssembly.

Upvotes: 7

Ivan Sanz Carasa
Ivan Sanz Carasa

Reputation: 1387

Blazor team expressed their concerns to make this part of the framework.

Luckily, there are some nice libraries to do this. I'm personally maintaining one of them, you can have a look at it.

https://github.com/isc30/blazor-lazy-loading

Upvotes: 0

Related Questions