stavroskasidis/BlazorWasmAntivirusProtection

LazyLoading

k3daevin opened this issue · 2 comments

I tried to combine this Library with LazyLoading according to this guide:
https://docs.microsoft.com/en-us/aspnet/core/blazor/webassembly-lazy-load-assemblies?view=aspnetcore-6.0#router-component-configuration

Unfortunately the project file configuration only allows ".dll" Files
https://docs.microsoft.com/en-us/aspnet/core/blazor/webassembly-lazy-load-assemblies?view=aspnetcore-6.0#project-file-configuration

So when using this approach, the AntivirusProtection gets bypassed and the pure DLLs are loaded directly.


Is there a way to use LazyLoading with AntivirusProtection?

Yes it can work. It just requires some extra considerations, for example checking if you are running in production to ask the assembly loader to fetch the renamed dll and making sure to not load the assembly twice.

I have created a working sample app so you can see how it works here:
https://github.com/stavroskasidis/BlazorWasmAntivirusProtection/tree/develop/sampleapps/BlazorHostedSampleLazyLoading

Oh thanks for the quick response! I will have a look into that.