Blazor without browser

фыч фыч 21 Reputation points
2022-09-20T02:14:52.62+00:00

Is it possible to render Blazor wasm without a browser or html5 electron or chromely frameworks?

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,378 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 55,041 Reputation points
    2022-09-20T15:25:05.507+00:00

    Blazor is three components

    A c# engine that builds a RazorTree structure. It uses async messages to communicate with the rendering component.

    A JavaScript and browser rendering component. This component renders the RazorTree into html. It also collects UI events and sends to the Blazor engine.

    A host(s) for the two engines. When WASM the browser hosts and supplies communication between the two components. When Blazor server is used, the server hosts the blazor engine, the browser the JavaScript engine, and signal/r is used for communication. When maui hosts, it hosts the blazor engine, the webkit view hosts the JavaScript and displays the rendered html.

    Blazor is designed to call JavaScript to render the html (as WASM does not have access to the dom). You could replace webkit with another JavaScript host and JavaScript rendering engine, but the JavaScript would need to render the RazorTree to something.


3 additional answers

Sort by: Most helpful
  1. Sreeju Nair 11,606 Reputation points
    2022-09-20T04:52:03.867+00:00

    Yes, it is possible. You may use MAUI Blazor App to create Android, iOS or UWP app (there are couple of other platforms it supports).

    Refer: https://learn.microsoft.com/en-us/aspnet/core/blazor/hybrid/tutorials/maui?view=aspnetcore-6.0
    https://learn.microsoft.com/en-us/aspnet/core/blazor/hybrid/?view=aspnetcore-6.0

    Hope this helps

    0 comments No comments

  2. фыч фыч 21 Reputation points
    2022-09-20T05:44:38.85+00:00

    The MAUI Blazor app uses BlazorWebView.
    In windows, BlazorWebView load Microsoft Edge WebView2 to display the blazor page. It turns out that the application loads external browser engines. This is the same as photino.net . Did I get it right?
    In search of the truth, I came across the ultralight project, it is based on WebKit and has a small volume. Available on Linux, Windows, macOS. Only this is a web engine. As far as I know, wasm can be used not only in web engines, but also directly in .NET. Ideally, I would like to remove the web engine from the "BlazorWebAssambly -web engine - app" chain. Is it possible?


  3. AlexChow 11 Reputation points MVP
    2022-12-07T21:16:35.53+00:00

    Your can use Blazor hybird ( wpf / winform ) with a project BlazorShared , link to MAUI and other plamform

    https://github.com/densen2014/BlazorMaui

    0 comments No comments