-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blazor WebAssembly lazy loading assemblies not working when using @ref attribute in the component #29342
Comments
@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? |
Thank you for contacting us. Due to a lack of activity on this discussion issue we're closing it in an effort to keep our backlog clean. If you believe there is a concern related to the ASP.NET Core framework, which hasn't been addressed yet, please file a new issue. This issue will be locked after 30 more days of inactivity. If you still wish to discuss this subject after then, please create a new issue! |
@mkArtakMSFT @javiercn @captainsafia The issue is closed itself by msftbot. Do we really need to create a new issue report for this? It is not yet discussed and it is under investigation. |
@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. |
Thanks for contacting us. |
@captainsafia ... My error from our offline chat is the same accessing a type in a lazily-loaded RCL assembly. Should I add my error details here or open a new issue? |
@guardrex You can add the details here. Both issues might have the same root cause. |
Error:
The error isn't thrown when the user tries to navigate to the component: It's thrown at app start up. The lazily-loaded RCL assembly ( public enum Axis
{
Left,
Right,
} The WASM app seeks to use the type in a component ( @page "/robot"
@using GrantImaharaRobotControls
...
@code {
private RobotModel robotModel = new() { AxisSelection = Axis.Left };
...
public class RobotModel
{
public Axis AxisSelection { get; set; }
}
} In if (args.Path.EndsWith("/robot"))
{
var assemblies = await AssemblyLoader.LoadAssembliesAsync(new[] { "GrantImaharaRobotControls.dll" });
lazyLoadedAssemblies.AddRange(assemblies);
} In the project file ... <ItemGroup>
<BlazorWebAssemblyLazyLoad Include="GrantImaharaRobotControls.dll" />
</ItemGroup> Repro project: https://github.com/guardrex/LazyLoadSolution To workaround this for the doc, I've simply placed the |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
Hi Guys, |
Hi Guys Because of @ref attribute issue, we cannot use lazy loading assembly feature in our project and it is downloading all referenced assemblies which is not required at initial startup page. Please do let us know that when it could be fixed. |
same problem |
Hi Guys, Any update on this issue. This affects using Lazy loading in blazor WASM apps. |
same problem |
Thanks for contacting us. We're moving this issue to the |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
Both repro projects seem to work fine with .NET 7, so it looks like this issue is now fixed. If you're still hitting this issue, please let us know and provide detailed steps to reproduce the problem and we'll take another look. |
Describe the bug
@ref
attribute, 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
~/LazyLoadingRef/LazyLoadingRef.csproj
file in theVS 2019
.~/LazyLoadingRef/Pages/Counter.razor
file and remove@ref
attribute andLazyLoadComponent
reference in the@code
section.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
The text was updated successfully, but these errors were encountered: