Skip to content

Blazor wasm lazy loading is not working #27331

Closed
@Stamo-Gochev

Description

@Stamo-Gochev

Describe the bug

Using lazy loading of assemblies fails when a service extension method is used.

Additional context

A blazor wasm project is configured to use lazy loading for a class library project that has some dependencies. The app is inspired by the example from Dan Roth and the MyComponents lib.

The problem occurs when a service extension method is used, which is empty. Not using this method works as expected and no errors are thrown.

To Reproduce

  1. Clone https://github.com/Stamo-Gochev/blazor-wasm-lazy-loading-issue
  2. Set the server project as a startup project
  3. Run the app by pressing Ctrl + F5

Expected

The dependency assemblies are loaded without errors.

Actual

An exception is thrown and the app crashes. The actual component that triggers lazy loading is in the Counter.razor file.

Exceptions (if any)

AN exception is thrown in the console

System.IO.FileNotFoundException: Could not load file or assembly 'MyComponents, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

Further technical details

  • ASP.NET Core version 5.0 RC2
  • Include the output of dotnet --info
  • The IDE (VS / VS Code/ VS4Mac) latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Status: Resolvedarea-blazorIncludes: Blazor, Razor Componentsfeature-blazor-wasmThis issue is related to and / or impacts Blazor WebAssembly

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions