MSBuild properties reference for the "BlazorWasmPreRendering.Build"

May 10, 2026 · View on GitHub

MSBuild properties list for the "BlazorWasmPreRendering.Build"

Property nameDdefault valueDescription
BlazorWasmPrerenderingSet the disable to suppress prerendering.
BlazorWasmPrerenderingRootComponentType$(RootNamespace).AppSet the full name (including namespace) of a root component class.
BlazorWasmPrerenderingRootComponentSelector#app,appSet the DOM element selector for attaching the root component.
BlazorWasmPrerenderingHeadOutletComponentSelectorhead::afterSet the DOM element selector for attaching the <HeadOutlet> component of the Blazor.
BlazorWasmPrerenderingOutputStyleIndexHtmlInSubFoldersWhen it is set to AppendHtmlExtension, the page of the URL path foo/bar will be saved as the foo/bar.html instead of the foo/bar/index.html.
BlazorWasmPrerenderingDeleteLoadingContentsfalseWhen it is set to true, the "Loading..." contents will be deleted from prerendered output HTML files, and prerendered contents to be visible immediately even before the Blazor WebAssembly runtime has warmed up.
BlazorWasmPrerenderingUrlPathToExplicitFetchSet the semicolon-separated URL paths explicitly that are not linked from anywhere, such as easter-egg pages, to be prerendered.
BlazorWasmPrerenderingUrlPathRegexToIgnoreSet a regular expression to skip paths that match it during the crawling process.
BlazorWasmPrerenderingEnvironmentPrerenderingSet a name of a host environment that can retrieve via IWebHostEnvironment.Environment.
BlazorWasmPrerenderingEmulateAuthMetrueWhen it is set to true, prerendering server emulates Azure App Services Auth. That means the ULR endpoint "/.auth/me" will return the JSON content {"clientPrincipal":null}
BlazorWasmPrerenderingLocaleenSet a comma-separated locale list such as "en", "ja-JP,en-US", etc., those used when crawling. ⚠️Attention: when you specify this MSBuild property via "dotnet" command line, you have to replace , (comma) with %2c.
BlazorWasmPrerenderingModeStaticSet the render mode in which Static or WebAssemblyPrerendered.
BlazorWasmPrerenderingPathBaseSet the base path (e.g. /repo/) for apps hosted under a sub path. If not set, the base path is auto-detected from the href attribute of the <base> element in index.html.
BlazorWasmPrerenderingKeepServerfalseWhen it is set to true, the dotnet publish command will not be exited, and the prerendering server process will keep running until Ctrl + C is pressed.

Appendix: How to set those MSBuild property values?

1. Specify it in a project file (.csproj)

You can specify MSBuild properties and their values inside of a project file (.csproj) like this:

<!-- This is the .csproj file of your Blazor WebAssembly app -->
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
  ...
  <PropertyGroup>
    <{Property name 1}>{Property value 1}</{Property name 1}>
    <{Property name 2}>{Property value 2}</{Property name 2}>
    ...
  </PropertyGroup>
  ...

2. Specify it in command-line arguments when the dotnet publish command executing

When you execute the dotnet publish command, you can specify MSBuild properties and their values by the -p command-line option with -p:{name}={value} syntax like this:

dotnet publish -c:Release -p:{Property name 1}={Property value 1} -p:{Property name 2}={Property value 2} ...

Warning
If you want to specify a comma-separated value as a property value, you must replace , (comma) with %2c.
ex.) dotnet publish -c:Release -p:BlazorWasmPrerenderingLocale=ja%2cen

3. Specify it in environment variables of the OS platforms

You can specify MSBuild properties and their values via environment variables of the OS platforms like this:

# An example for PowerShell
> $env:{Property name 1} = "{Property value 1}"
> $env:{Property name 2} = "{Property value 2}"
# An example for Bash
> export {Property name 1}="{Property value 1}"
> export {Property name 2}="{Property value 2}"