MAUIverse MAUIverse

Deploying .NET MAUI Blazor App to ProgramFiles

Deploying a .NET MAUI Blazor app as a simple exe works fine from the output directory — but move it to C:\Program Files and it shows a splash page with no errors and a totally unusable application. This post explains why and provides a quick fix.

What you’ll learn

  • Why .NET MAUI Blazor creates a WebView2 folder in the application directory by default, and why that fails in secured folders
  • How to override the storage location by setting the WEBVIEW2_USER_DATA_FOLDER environment variable in MauiProgram.cs
  • How to use a compiler directive to only apply the fix on the Windows target

View Source →

← Back to Community Feed

}