stavroskasidis/BlazorWasmAntivirusProtection

Multiple WASM Apps issue with renaming dlls

peterthorpe81 opened this issue · 4 comments

I have a hosted blazor project that hosts two WASM apps. One at root / and one at /Public this is to enable different security on each. This is based on the multiple hosting example here https://github.com/javiercn/BlazorMultipleApps updated to .NET 6.0.

Dll's in both projects get the headers changed as PublishBlazorBootStaticWebAsset is passed in for each project but renaming is only on the first _framework folder found:

var frameworkDir = Directory.GetDirectories(PublishDir, "_framework", SearchOption.AllDirectories).First();

My project will have _Framework at wwwroot/_framework and wwwroot/Public/_framework.

Changing to a foreach loop appears to fix it although I am not sure if serviceworker needs adjusting too (I don't use it) I imagine a second service worker would end up in wwwroot/Public

foreach(var frameworkDir in Directory.GetDirectories(PublishDir, "_framework", SearchOption.AllDirectories))

There may be a cleaner way to do this. I assume the PublishBlazorBootStaticWebAsset isn't available after Publish otherwise you would just loop the files with a special case for blazor.boot.json and service-worker-assets.js

Thank you for reporting this. I will check out the example and see how it is best to handle this.

Can you confirm that the 1.4.0-beta package solves the problem ?

Fantastic! Yes all working.

Thank you. I will merge the PR into master now.