aspnetcore: Blazor WebAssembly lazy loading assemblies not working when using @ref attribute in the component
Describe the bug
- When using Blazor WebAssembly lazy loading assemblies with component’s
@refattribute, the corresponding assembly could not load issue throws in the browser console and the application not running.
To Reproduce
https://github.com/ajithr/blazor-wasm-lazy-ref
- Check out the above repo and open
~/LazyLoadingRef/LazyLoadingRef.csprojfile in theVS 2019. - Run the application it will throw exceptions in the browser console.
- Open
~/LazyLoadingRef/Pages/Counter.razorfile and remove@refattribute andLazyLoadComponentreference in the@codesection. - Run the sample again and it will work properly with the lazy loading feature.

Exceptions (if any)

Further technical details
-
ASP.NET Core version -
.net5.0 -
Include the output of
dotnet --info
-
The IDE (VS / VS Code/ VS4Mac) you’re running on, and its version

About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 12
- Comments: 17 (11 by maintainers)
Hi Guys, I’m facing same exceptions. May I know the status of this issue?
@ajithr Thanks for the following up. Reopening this issue and moving to backlog.
I had a hunch that this might be caused by some issues that existed in the codepaths used for assembly loading in the WASM runtime. We’ll need to (1) validate if this still happens in .NET 6 and (2) investigate why if it does.
@ajithr thanks for contacting us.
This seems to be an issue, I can’t tell there’s anything wrong from looking at the code.
@captainsafia do you have any thoughts?