Skip to content

Referencing Blazor wasm hosted project in Blazor MAUI project #4521

@nssidhu

Description

@nssidhu

Description

First I want to confirm if the following is officially supported or I just happen to stumble upon something that is not fully supported ?

I have existing Blazor WebAssembly hosted PWA Project that I want to publish to iOS & Android platform, without any changes.

I added reference to Blazor wasm hosted (client Project) from Blazor MAUI Project.
I can launch Blazor Maui and display the pages from Blazor wasm hosted project.
But when I access weather forecast page which makes an http call, the mobile app entirely crashes.
What am I missing here for that page ?

Here is the project that i gave a try.
https://1drv.ms/v/s!AtHk7h6Srnk_h-B--nkQMyenoWtz1w?e=HuIcQb

Steps to Reproduce

  1. Create Blazor MAUI Project
  2. Compile and run the MAUI Project
  3. Add Blazor wasm hosted PWA project to the solution.
    change the Startup Project
  4. Run the Blazor Hosted wasm server project.

Next Change the startup project to Blazor MAUI and run it
Add Project Reference to the Blazor wasm Client Project.

Try to run the Blazor MAUI Project , you will get lots of compile error.
To resolve the errors
Delete Pages folder
Delete Everything for wwwroot project

Run Blazor MAUI project, it should launch successfully and display pages from Blazor wasm hosted project.

When you navigate to weather page it will crash the mobile app

Version with bug

Preview 7

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Version 17.1.0 Preview 5.0

Did you find any workaround?

No

Relevant log output

https://1drv.ms/v/s!AtHk7h6Srnk_h-B--nkQMyenoWtz1w?e=HuIcQb

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions