

An ASP.NET Core web server isn't required to host the app.Work is offloaded from the server to the client.Client resources and capabilities are fully leveraged.The app is fully functioning after downloaded to the client. The Blazor WebAssembly hosting model has the following benefits:
Apple server hosting how to#
How to choose the right Blazor hosting modelĪs described in the Blazor hosting model docs, the different Blazor hosting models have different tradeoffs. Aside from those differences, the two models are conceptually similar. Additionally, all UI state is maintained on the server. Blazor Server apps are slightly different in that the app requires an active connection with the client. The state of the UI is managed using ViewState.
Apple server hosting update#
When triggered, the UpdatePanel requests a partial update and then applies it without needing to refresh the page. The UpdatePanel control handles applying partial page updates in response to trigger events on the page. The Blazor Server hosting model may sound familiar if you've used ASP.NET AJAX and the UpdatePanel control. The components render, and the calculated UI diff is serialized and sent to the browser where it's applied to the DOM. The events are dispatched to the correct component instances. UI events that occur in the browser are sent to the server over a real-time connection. In Blazor Server apps, the components run on the server instead of client-side in the browser. In fact, they don't even have to run on the same machine. Consequently, the components themselves don't have to run in the same process as the process updating the UI. Blazor components are decoupled from how their rendered output is applied. The Blazor framework then compares what was rendered with what was previously rendered. Recall from the Blazor architecture discussion that Blazor components render their output to an intermediate abstraction called a RenderTree. When the solution is built, the built static files from the Blazor app are hosted by the ASP.NET Core app with fallback routing already setup. Blazor provides convenient templates for setting up a solution that contains both a Blazor WebAssembly app and an ASP.NET Core host project.
Apple server hosting code#
NET on both the client and server, you can easily share code and build your app using one consistent set of languages, frameworks, and tools. NET web development, host your Blazor WebAssembly app with ASP.NET Core. To get all the benefits of Blazor and full-stack. For example, this redirection can be handled using URL rewrite rules in IIS. The routing solution redirects requests to the root of the app. Deep linking to parts of the app typically requires a routing solution on the server. Such apps can be deployed to static site hosting solutions like GitHub Pages or Azure Static Website Hosting.NET isn't required on the server at all. The DOM updates are then applied.īlazor WebAssembly apps run purely client-side.

Blazor calculates the UI updates based on the rendered output from the components. The app startup logic runs, and the root components are rendered. NET runtime is started and pointed at the app assembly. Some functionality may throw a PlatformNotSupportedException, like trying to access the file system or opening arbitrary network connections. However, these assemblies will still execute in the browser security sandbox. NET Standard libraries with your Blazor WebAssembly app. NET assemblies, like you would use in any other. No browser plugins or extensions are required. NET runtime is downloaded with the app along with the app assembly and any required dependencies. However, instead of writing JavaScript you write C#. Blazor WebAssembly apps function in a similar way to front-end JavaScript frameworks like Angular or React.
