A hybrid blazor app is a WASM (client) app hosted by a webview, and does not support pre-render, server interactive, or auto as there is no server code to support. The only supported mode is InteractiveWebAssembly
Using the method suggested by Microsoft for a WPF-Blazor hybrid app, an exception is thrown if any of the blazor pages is set to an interactive server render mode
Basically, I'm trying to build a hybrid app with a Web version and a Windows version. I've tried following this tutorial:
https://learn.microsoft.com/en-us/aspnet/core/blazor/hybrid/tutorials/wpf?view=aspnetcore-8.0
However, there are a few pages in my app that must use @rendermode @(new InteractiveServerRenderMode(prerender: false))
. I need the interactivity to use FluentUI Dialog components.
The web version works fine, but if I try to launch the WPF app, it immediately runs into the following exception:
NotSupportedException: Cannot supply a component of type 'X' because the current platform does not support the render mode 'Microsoft.AspNetCore.Components.Web.InteractiveServerRenderMode'.
I've tried adding services.AddRazorComponents().AddInteractiveServerComponents();
to the Form constructor, but that gives me another exception:
InvalidCastException: Unable to cast object of type 'Microsoft.AspNetCore.Components.Server.Circuits.RemoteNavigationManager' to type 'Microsoft.AspNetCore.Components.WebView.Services.WebViewNavigationManager'.
So now I'm stuck and I can't find any documentation providing answers. Is there a way to solve this?