Skip to content

[Pre ?] Blazor startup options format #34660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion aspnetcore/blazor/fundamentals/environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,14 @@ For general guidance on ASP.NET Core app configuration, see <xref:fundamentals/e

The following example starts Blazor in the `Staging` environment if the hostname includes `localhost`. Otherwise, the environment is set to its default value.

:::moniker range=">= aspnetcore-8.0"
:::moniker range=">= aspnetcore-8.0 < aspnetcore-10.0"

Blazor Web App:

:::moniker-end

:::moniker range=">= aspnetcore-8.0"

```html
<script src="{BLAZOR SCRIPT}" autostart="false"></script>
<script>
Expand All @@ -116,10 +120,16 @@ Blazor Web App:
> [!NOTE]
> For Blazor Web Apps that set the `webAssembly` > `environment` property in `Blazor.start` configuration, it's wise to match the server-side environment to the environment set on the `environment` property. Otherwise, prerendering on the server will operate under a different environment than rendering on the client, which results in arbitrary effects. For general guidance on setting the environment for a Blazor Web App, see <xref:fundamentals/environments>.

:::moniker-end

:::moniker range=">= aspnetcore-8.0 < aspnetcore-10.0"

Standalone Blazor WebAssembly:

:::moniker-end

:::moniker range="< aspnetcore-10.0"

```html
<script src="{BLAZOR SCRIPT}" autostart="false"></script>
<script>
Expand All @@ -133,6 +143,8 @@ Standalone Blazor WebAssembly:
</script>
```

:::moniker-end

**In the preceding example, the `{BLAZOR SCRIPT}` placeholder is the Blazor script path and file name.** For the location of the script, see <xref:blazor/project-structure#location-of-the-blazor-script>.

:::moniker range="< aspnetcore-10.0"
Expand Down
28 changes: 26 additions & 2 deletions aspnetcore/blazor/fundamentals/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -670,10 +670,14 @@ For the `configureLogging` log level value, pass the argument as either the stri

Example 1: Set the <xref:Microsoft.Extensions.Logging.LogLevel.Information> log level with a string value.

:::moniker range=">= aspnetcore-8.0"
:::moniker range=">= aspnetcore-8.0 < aspnetcore-10.0"

Blazor Web App:

:::moniker-end

:::moniker range=">= aspnetcore-8.0"

```html
<script src="{BLAZOR SCRIPT}" autostart="false"></script>
<script>
Expand All @@ -687,10 +691,16 @@ Blazor Web App:
</script>
```

:::moniker-end

:::moniker range=">= aspnetcore-8.0 < aspnetcore-10.0"

Blazor Server:

:::moniker-end

:::moniker range="< aspnetcore-10.0"

```html
<script src="{BLAZOR SCRIPT}" autostart="false"></script>
<script>
Expand All @@ -702,14 +712,20 @@ Blazor Server:
</script>
```

:::moniker-end

**In the preceding example, the `{BLAZOR SCRIPT}` placeholder is the Blazor script path and file name.** For the location of the script, see <xref:blazor/project-structure#location-of-the-blazor-script>.

Example 2: Set the <xref:Microsoft.Extensions.Logging.LogLevel.Information> log level with an integer value.

:::moniker range=">= aspnetcore-8.0"
:::moniker range=">= aspnetcore-8.0 < aspnetcore-10.0"

Blazor Web App:

:::moniker-end

:::moniker range=">= aspnetcore-8.0"

```html
<script src="{BLAZOR SCRIPT}" autostart="false"></script>
<script>
Expand All @@ -723,10 +739,16 @@ Blazor Web App:
</script>
```

:::moniker-end

:::moniker range=">= aspnetcore-8.0 < aspnetcore-10.0"

Blazor Server:

:::moniker-end

:::moniker range="< aspnetcore-10.0"

```html
<script src="{BLAZOR SCRIPT}" autostart="false"></script>
<script>
Expand All @@ -738,6 +760,8 @@ Blazor Server:
</script>
```

:::moniker-end

**In the preceding example, the `{BLAZOR SCRIPT}` placeholder is the Blazor script path and file name.** For the location of the script, see <xref:blazor/project-structure#location-of-the-blazor-script>.

> [!NOTE]
Expand Down
Loading