Closed mediabuff closed 1 year ago
@mediabuff thanks for contacting us.
This is not a scenario we support, nor something we plan to address. It seems that you are trying to host newer features (components) inside an older version of the framework. This is not something we plan to address, it does not make sense for Components Webview to take a dependency on ASP.NET Core.
Thanks for your quick response. a) >>to host newer features (components) inside an older version of the framework. Well, then what is the right way to host Razor views (*.cshtml) in wpf ?
b) I have shared code in Blazor Server and Wpf Blazor Hybrid. For Server, the start page is _Host.cshml, but for wpf it is index. html. I have quite of a bit of dynamic content in _host.cshml - how do I get that in wpf index.html without hosting Razor views in wpf.
This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.
See our Issue Management Policies for more information.
Is there an existing issue for this?
Describe the bug
Hi, I am trying to host Razor views (*.cshtml) in an hybrid wpf app (BlazorWebView). Got everyting working with memory based OWIN loopback. But ran into this cast when Microsoft.AspNetCore.Mvc.ViewFeatures.StaticComponentRenderer tries to render it.
It appears webview NavigationManager does not implement IHostEnvironmentNavigationManager, which the MVC stack expects.
Should'nt webview NavigationManager be implemented similiar to
https://github.com/dotnet/aspnetcore/blob/main/src/Components/Server/src/Circuits/RemoteNavigationManager.cs
Expected Behavior
Implement IHostEnvironmentNavigationManager on Webview NavigationManager.
Steps To Reproduce
Start with Wpf Hybrid app and add MVC stack with owin middleware.
Exceptions (if any)
InvalidCastException
.NET Version
.Net 7
Anything else?
No response