# WebAssembly

The Blazor AI Migrator is expanding to support Blazor WebAssembly (WASM), offering a powerful alternative to the server-centric LiveView model. This addition allows your migrated applications to run C# code directly in the user's browser, bringing the web experience even closer to the performance of the original desktop app.

#### ⚡ What is Blazor WebAssembly?

WebAssembly is a modern web standard that enables high-performance, binary code to run in the browser. In this model, the .NET runtime and your application assemblies are downloaded to the client machine, allowing the app to execute locally without a constant "tether" to the server.

<figure><img src="/files/4Cg2219TTWElrn4fn0Mm" alt="Blazor Server vs Blazor WebAssembly" width="375"><figcaption><p>Blazor Server vs Blazor WebAssembly</p></figcaption></figure>

#### 🌟 Key Benefits of the WASM Model

By adding WebAssembly support, the migrator offers new strategic advantages for your modernized apps:

* Offline Capability: Unlike the server model, WASM apps can continue to function even if the internet connection is interrupted, as the logic lives in the browser.
* Zero Latency Interactivity: UI events (like clicking a tab or opening a menu) happen instantly on the client, eliminating the "network hop" required by the LiveView/SignalR model.
* Server Offloading: Processing power is shifted from your expensive cloud servers to the user's own hardware, significantly reducing hosting costs for high-traffic applications.
* Static Hosting: WASM apps can be served from simple, cost-effective storage like a Content Delivery Network (CDN) or Azure Static Web Apps, as they don't require a full ASP.NET Core server to run.

<figure><img src="/files/Yue8ItCwNHI28JSztWRC" alt="" width="375"><figcaption><p>Main difference</p></figcaption></figure>

#### 🛠️ Updated Installation for WASM Support

To enable these features, you must add the following to your environment:

1. WASM Build Tools: In the Visual Studio Installer, select the .NET WebAssembly build tools option under the ASP.NET and web development workload.
2. CLI Command: Alternatively, you can run `dotnet workload install wasm-tools` from an administrative prompt.
3. Project Configuration: Your project will now include a `<RunAOTCompilation>` property to trigger high-performance native execution.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gapvelocity.ai/webmap-for-blazor-documentation/blazor-ai-migrator/modernization/webassembly.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
