---
title: ASP.NET Core Blazor Progressive Web Application (PWA)
author: guardrex
description: Learn how to build a Blazor Progressive Web Application (PWA) that use modern browser features to behave like a desktop app.
monikerRange: '>= aspnetcore-3.1'
ms.author: riande
ms.custom: mvc
ms.date: 11/12/2024
uid: blazor/progressive-web-app
---
# ASP.NET Core Blazor Progressive Web Application (PWA)
[!INCLUDE[](~/includes/not-latest-version.md)]
A Blazor Progressive Web Application (PWA) is a single-page application (SPA) that uses modern browser APIs and capabilities to behave like a desktop app.
Blazor WebAssembly is a standards-based client-side web app platform, so it can use any browser API, including PWA APIs required for the following capabilities:
* Working offline and loading instantly, independent of network speed.
* Running in its own app window, not just a browser window.
* Being launched from the host's operating system start menu, dock, or home screen.
* Receiving push notifications from a backend server, even while the user isn't using the app.
* Automatically updating in the background.
The word *progressive* is used to describe these apps because:
* A user might first discover and use the app within their web browser like any other SPA.
* Later, the user progresses to installing it in their OS and enabling push notifications.
## Create a project from the PWA template
# [Visual Studio](#tab/visual-studio)
When creating a new **Blazor WebAssembly App**, select the **Progressive Web Application** checkbox.
# [Visual Studio Code / .NET CLI](#tab/visual-studio-code+net-cli)
Use the following command to create a PWA project in a command shell with the `--pwa` switch:
```dotnetcli
dotnet new blazorwasm -o MyBlazorPwa --pwa
```
In the preceding command, the `-o|--output` option creates a new folder for the app named `MyBlazorPwa`.
---
:::moniker range="< aspnetcore-8.0"
Optionally, PWA can be configured for an app created from the **ASP.NET Core Hosted** Blazor WebAssembly project template. The PWA scenario is independent of the hosting model.
:::moniker-end
## Convert an existing Blazor WebAssembly app into a PWA
Convert an existing Blazor WebAssembly app into a PWA following the guidance in this section.
In the app's project file:
* Add the following `ServiceWorkerAssetsManifest` property to a `PropertyGroup`:
```xml
...
service-worker-assets.js
```
* Add the following `ServiceWorker` item to an `ItemGroup`:
```xml
```
To obtain static assets, use **one** of the following approaches:
* Create a separate, new PWA project with the [`dotnet new`](/dotnet/core/tools/dotnet-new) command in a command shell:
```dotnetcli
dotnet new blazorwasm -o MyBlazorPwa --pwa
```
In the preceding command, the `-o|--output` option creates a new folder for the app named `MyBlazorPwa`.
**If you aren't converting an app for the latest release**, pass the `-f|--framework` option. The following example creates the app for ASP.NET Core version 5.0:
```dotnetcli
dotnet new blazorwasm -o MyBlazorPwa --pwa -f net5.0
```
:::moniker range=">= aspnetcore-8.0"
* Navigate to the ASP.NET Core GitHub repository at the following URL, which links to `main` branch reference source and assets. Select the release that you're working with from the **Switch branches or tags** dropdown list that applies to your app.
[Blazor WebAssembly project template `wwwroot` folder (`dotnet/aspnetcore` GitHub repository `main` branch)](https://github.com/dotnet/aspnetcore/tree/main/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/wwwroot)
[!INCLUDE[](~/includes/aspnetcore-repo-ref-source-links.md)]
From the source `wwwroot` folder either in the app that you created or from the reference assets in the `dotnet/aspnetcore` GitHub repository, copy the following files into the app's `wwwroot` folder:
* `icon-192.png`
* `icon-512.png`
* `manifest.webmanifest`
* `service-worker.js`
* `service-worker.published.js`
In the app's `wwwroot/index.html` file:
* Add `` elements for the manifest and app icon:
```html
```
:::moniker-end
:::moniker range="< aspnetcore-8.0"
* Navigate to the ASP.NET Core GitHub repository at the following URL, which links to the `v7.0.0` tag reference source and assets. If you're using a version of ASP.NET Core later than 7.0, change the document version selector at the top of this article to see the updated guidance for this section. Select the release that you're working with from the **Switch branches or tags** dropdown list that applies to your app.
[Blazor WebAssembly project template `wwwroot` folder (`v7.0.0` tag)](https://github.com/dotnet/aspnetcore/tree/v7.0.0/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot)
[!INCLUDE[](~/includes/aspnetcore-repo-ref-source-links.md)]
From the source `wwwroot` folder either in the app that you created or from the reference assets in the `dotnet/aspnetcore` GitHub repository, copy the following files into the app's `wwwroot` folder:
* `favicon.png`
* `icon-192.png`
* `icon-512.png`
* `manifest.json`
* `service-worker.js`
* `service-worker.published.js`
In the app's `wwwroot/index.html` file:
* Add `` elements for the manifest and app icon:
```html
```
:::moniker-end
* Add the following `