[View or download sample code](https://github.com/dotnet/AspNetCore.Docs/tree/master/aspnetcore/tutorials/signalr-blazor-webassembly/samples/) ([how to download](xref:index#how-to-download-a-sample))
Install the [Blazor WebAssembly](xref:blazor/hosting-models#blazor-webassembly) template. The [Microsoft.AspNetCore.Components.WebAssembly.Templates](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebAssembly.Templates/) package has a preview version while Blazor WebAssembly is in preview. In a command shell, execute the following command:
1. Type "BlazorSignalRApp" in the **Project name** field. Confirm the **Location** entry is correct or provide a location for the project. Select **Create**.
1. Choose the **Blazor WebAssembly App** template.
1. Under **Advanced**, select the **ASP.NET Core hosted** check box.
1. Select **Create**.
> [!NOTE]
> If you upgraded or installed a new version of Visual Studio and the Blazor WebAssembly template doesn't appear in the VS UI, reinstall the template using the `dotnet new` command shown previously.
# [Visual Studio Code](#tab/visual-studio-code)
1. In a command shell, execute the following command:
```dotnetcli
dotnet new blazorwasm --hosted --output BlazorSignalRApp
```
1. In Visual Studio Code, open the app's project folder.
1. When the dialog appears to add assets to build and debug the app, select **Yes**. Visual Studio Code automatically adds the *.vscode* folder with generated *launch.json* and *tasks.json* files.
# [Visual Studio for Mac](#tab/visual-studio-mac)
1. In a command shell, execute the following command:
```dotnetcli
dotnet new blazorwasm --hosted --output BlazorSignalRApp
```
1. In Visual Studio for Mac, open the project by navigating to the project folder and opening the project's solution file (*.sln*).
# [.NET Core CLI](#tab/netcore-cli/)
In a command shell, execute the following command:
```dotnetcli
dotnet new blazorwasm --hosted --output BlazorSignalRApp
```
---
## Add the SignalR client library
# [Visual Studio](#tab/visual-studio/)
1. In **Solution Explorer**, right-click the **BlazorSignalRApp.Client** project and select **Manage NuGet Packages**.
1. In the **Manage NuGet Packages** dialog, confirm that the **Package source** is set to *nuget.org*.
1. With **Browse** selected, type "Microsoft.AspNetCore.SignalR.Client" in the search box.
1. In the search results, select the `Microsoft.AspNetCore.SignalR.Client` package and select **Install**.
1. If the **Preview Changes** dialog appears, select **OK**.
1. If the **License Acceptance** dialog appears, select **I Accept** if you agree with the license terms.
# [Visual Studio Code](#tab/visual-studio-code/)
In the **Integrated Terminal** (**View** > **Terminal** from the toolbar), execute the following commands:
1. In **Solution Explorer**, select the **BlazorSignalRApp.Server** project. Press **Ctrl+F5** to run the app without debugging.
1. Copy the URL from the address bar, open another browser instance or tab, and paste the URL in the address bar.
1. Choose either browser, enter a name and message, and select the **Send** button. The name and message are displayed on both pages instantly:
![SignalR Blazor WebAssembly sample app open in two browser windows showing exchanged messages.](signalr-blazor-webassembly/_static/3.x/signalr-blazor-webassembly-finished.png)
1. Select **Debug** > **Run Without Debugging** from the toolbar.
1. Copy the URL from the address bar, open another browser instance or tab, and paste the URL in the address bar.
1. Choose either browser, enter a name and message, and select the **Send** button. The name and message are displayed on both pages instantly:
![SignalR Blazor WebAssembly sample app open in two browser windows showing exchanged messages.](signalr-blazor-webassembly/_static/3.x/signalr-blazor-webassembly-finished.png)
1. In the **Solution** sidebar, select the **BlazorSignalRApp.Server** project. From the menu, select **Run** > **Start Without Debugging**.
1. Copy the URL from the address bar, open another browser instance or tab, and paste the URL in the address bar.
1. Choose either browser, enter a name and message, and select the **Send** button. The name and message are displayed on both pages instantly:
![SignalR Blazor WebAssembly sample app open in two browser windows showing exchanged messages.](signalr-blazor-webassembly/_static/3.x/signalr-blazor-webassembly-finished.png)
1. In a command shell, execute the following commands:
```dotnetcli
cd Server
dotnet run
```
1. Copy the URL from the address bar, open another browser instance or tab, and paste the URL in the address bar.
1. Choose either browser, enter a name and message, and select the **Send** button. The name and message are displayed on both pages instantly:
![SignalR Blazor WebAssembly sample app open in two browser windows showing exchanged messages.](signalr-blazor-webassembly/_static/3.x/signalr-blazor-webassembly-finished.png)