Introduction
How many of us know that Blazor WebAssembly applications have offline support?. They can convert our Web Application into a Desktop or Mobile Application, and that is called a Progressive Web Application (PWA). In this article, we will discuss how to convert our WebAssembly Application into a Progressive Web Application (PWA), how do a PWA application works, PWA limitations, when to use PWA.
What are Progressive Web Apps (PWA)
In simple words, PWA is an enhanced version of Web Applications. PWA gives extra capabilities like Offline Usage, Push Notifications and most importantly, we can install it as a normal app on mobile and desktop. PWA is trying to bridge the gap between native and web apps. PWA is a Web Technology
Creating PWA with Blazor WebAssembly
- Start Visual Studio 2019 and select Create a new project
- Choose Blazor App as a project template.
Fig.1 Choose Blazor App as a project template
- Save the project in the location by giving proper names

Fig. 2 Save the project in a location
- In the next step choose Blazor WebAssembly App, from the option. In order to create PWA, we need to choose Blazor WebAssembly App, since PWA always does not have a server. We also need to enable the Progressive Web Application as shown below. By enabling, it will turn our Blazor WebAssembly Application into a Progressive Web Application.

Fig. 3 Choose Blazor WebAssembly and Enable the Progressive Web Application Option
- Click Create button and now we have successfully created our project
Project Structure
If you are already familiar with Blazor WebAssembly project structure, nothing has changed under Pages and Shared folders, and also nothing much changed in _Imports.razor, App.razor and Program.cs files as well.

The place we do have changes in files for PWA is under the wwwroot folder

We can see four new files as icon-512.png, manifest.json, service-worker.js, and service-worker.published.js
icon-512.png
The Desktop Icon for our application, which is the default blazor icon
manifest.json
This JSON file is the root heart of the PWA. This is an industrial standard life. In this file we will declare and setup the PWA.
- {
- "name": "PWABlazor",
- "short_name": "PWABlazor",
- "start_url": "./",
- "display": "standalone",
- "background_color": "#ffffff",
- "theme_color": "#03173d",
- "icons": [{
- "src": "icon-512.png",
- "type": "image/png",
- "sizes": "512x512"
- }]
- }







Divyansh GuptaPosted Apr 7, 2023, 4:58 AM
I have a fully built Blazor server Application so I want to add PWA to it so is there any way to do that ?? I am using visual studio 2022.
Ronald AbellanoPosted Apr 12, 2022, 2:27 PM
Why my Blazor wasm PWA does not have the download function from the browser? But the browser have send, qr and read aloud.