How do I deploy a Microsoft Blazor application? Print

  • deploy blazor
  • 44

Deploying Blazor Applications to Plesk Windows Hosting

Updated for .NET 8+: This guide covers all Blazor hosting models including the new Blazor Web App unified model.

Blazor Hosting Models

Before deploying, understand which Blazor model you are using:

ModelRuns OnBest For
Blazor ServerServer (SignalR)Internal apps, sensitive data
Blazor WebAssemblyBrowserPublic apps, offline capability
Blazor Web App (.NET 8+)BothFlexible per-component choice

Creating a Blazor Project (.NET 8+)

  1. Open Visual Studio 2022 (17.8 or later)
  2. Click Create a new project
  3. Select Blazor Web App (for .NET 8+) or Blazor WebAssembly Standalone App
  4. Configure project name and location
  5. Select .NET 8.0 or .NET 9.0 or .NET 10.0
  6. Choose your interactivity options:
    • Server - Interactive Server rendering
    • WebAssembly - Interactive WebAssembly rendering
    • Auto - Server first, then WebAssembly
    • None - Static server rendering only
  7. Click Create

Publishing to Plesk

Method 1: Web Deploy (Recommended)

  1. In Plesk, go to Websites & Domains → your domain
  2. Click Web Deploy Publishing Settings
  3. Download the .publishsettings file
  4. In Visual Studio, right-click your project → Publish
  5. Click Import Profile and select the downloaded file
  6. Enter your Plesk password when prompted
  7. Click Publish

Method 2: FTP Upload

  1. Publish locally: dotnet publish -c Release -o ./publish
  2. Connect via FTP to your domain
  3. Upload contents of publish folder to httpdocs

Configure Plesk for Blazor

  1. Go to Hosting Settings
  2. Set .NET Core Version to 8.0.x (or your target version)
  3. Set Application Startup File to your main DLL (e.g., MyBlazorApp.dll)
  4. Click OK

Blazor WebAssembly: Additional Configuration

Add MIME types to web.config for WebAssembly files:

<staticContent>
  <remove fileExtension=".wasm" />
  <mimeMap fileExtension=".wasm" mimeType="application/wasm" />
  <remove fileExtension=".br" />
  <mimeMap fileExtension=".br" mimeType="application/brotli" />
</staticContent>

.NET 8+ Render Modes

In .NET 8+, specify render modes per component:

@* Static server rendering *@
@rendermode Static

@* Interactive server (SignalR) *@
@rendermode InteractiveServer

@* Interactive WebAssembly *@
@rendermode InteractiveWebAssembly

@* Auto (Server first, then WASM) *@
@rendermode InteractiveAuto

Troubleshooting

  • App not loading: Check stdout logs for startup errors
  • SignalR disconnects: See our SignalR troubleshooting article
  • Static assets missing: Verify MIME types and file permissions
  • WASM integrity errors: Use binary mode for FTP transfers

For more details, see our specialized Blazor articles in the Blazor Development category.


Was this answer helpful?

« Back