-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Resolved because the question asked by the original author has been answered.Status: Resolvedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
I have a simple Weather app that consists of 3 projects:
- BlazorApp1 (server and API controller for the client)
- BlazorApp1.Client (client)
- ClassLibrary1 (shared lib)
Class Library holds interfaces, and service-implementations.
- In BlazorApp1, I inject the IWeatherService to use WeatherService.cs
- In BlazorApp1.Client, I inject the IWeatherService to use HttpClientWeatherService.cs
in Weather.razor (BlazorApp1.Client.Components.Weather.razor
), I inject IWeatherService and use GetForecastsAsync()-method to get forecasts.
I noticed the app keeps using Server implementation (WeatherService.cs) at first (both navigating from /counter back to weather and F5 refresh) then switches to WASM implementation (HttpClientWeatherService.cs), even though the app is finished downloaded in the background.
Expected Behavior
I expect the Web App to only use the WASM implementation of the service, when the application is downloaded and cached.
Steps To Reproduce
- Clone https://github.com/dmm-l-mediehus/BlazorApp1-RenderModeIssue
- Run the app with debugging (F5)
- Set breakpoints at the HttpClientWeatherService.cs line 19, and WeatherService.cs line 22
- Navigate to /weather and the breakpoint will hit Server at first which is fine initially. But when navigating to another page, and back to /weather - it should hit the WASM breakpoint, but doesn't. Same for F5 - it should use the HttpClientWeatherService.cs implementation
Exceptions (if any)
No response
.NET Version
8.0.100-rc.1.23455.8
Anything else?
No response
Metadata
Metadata
Assignees
Labels
✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Resolved because the question asked by the original author has been answered.Status: Resolvedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components