Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

.NET 9 Blazor Hybrid with web app. Accessing WebAssembly DI

$
0
0

In the Visual Studio template for .NET MAUI Blazor Hybrid and web app template with "InteractiveWebAssembly", I get the following projects:

  • MauiApp1 (Mobile and Windows Clients)
  • MauiApp1.Web (The host that serves Web.Client)
  • MauiApp1.Web.Client (The client / WASM)
  • MauiApp1.Shared (Shared components and interfaces)

There is a service interface IFormFactor defined in the shared project with an implementation in each of the other three projects.

When I start my solution with the web project as the startup project, I can see that the first load of the page used the web implementation of IFormFactor, and if I navigate away and come back, then I see it using the Web.Client implementation of IFormFactor.

I understand that this is due to server pre-rendering.

In my case I only want to use services from the client. How can I avoid that pre-rendering so the first render uses services injected from the client DI, instead of the server DI?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>