You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/blazor/host-and-deploy/index.md
+26-4Lines changed: 26 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -28,12 +28,22 @@ Apps are published for deployment in Release configuration.
28
28
# [Visual Studio](#tab/visual-studio)
29
29
30
30
1. Select the **Publish {APPLICATION}** command from the **Build** menu, where the `{APPLICATION}` placeholder the app's name.
31
-
1. Select the *publish target*. To publish locally, select **Folder**.
32
-
1. Accept the default location in the **Choose a folder** field or specify a different location. Select the **`Publish`** button.
31
+
1. Select the *publish target*. To publish locally, select **Folder**. Select **Next**.
32
+
1. When publishing locally, accept the default folder location or specify a different location. Select **Finish** to save the profile. Select **Close**.
33
+
1. To clean the target's publish folder prior to publishing the app, select **Show all settings**. Select **Settings** > **File Publish Options** > **Delete all existing files prior to publish**. Select **Save**.
34
+
1. Select the **Publish** button.
33
35
34
-
# [.NET CLI](#tab/net-cli)
36
+
# [Visual Studio Code and .NET CLI](#tab/visual-studio-code-dotnet-cli)
35
37
36
-
Use the [`dotnet publish`](/dotnet/core/tools/dotnet-publish) command to publish the app with a Release configuration:
38
+
Open a command shell to the project's root directory.
39
+
40
+
Use the [`dotnet publish`](/dotnet/core/tools/dotnet-publish) command to publish the app:
41
+
42
+
```dotnetcli
43
+
dotnet publish
44
+
```
45
+
46
+
Prior to .NET 8, the default publish configuration is `Debug`. When publishing an app that targets .NET 7 or earlier, pass the `-c|--configuration` option to the command with "`Release`" to publish in `Release` configuration:
37
47
38
48
```dotnetcli
39
49
dotnet publish -c Release
@@ -43,6 +53,18 @@ dotnet publish -c Release
43
53
44
54
Publishing the app triggers a [restore](/dotnet/core/tools/dotnet-restore) of the project's dependencies and [builds](/dotnet/core/tools/dotnet-build) the project before creating the assets for deployment. As part of the build process, unused methods and assemblies are removed to reduce app download size and load times.
45
55
56
+
## Empty the target publish folder
57
+
58
+
When using the [`dotnet publish`](/dotnet/core/tools/dotnet-publish) command in a command shell to publish an app, the command generates the necessary files for deployment based on the current state of the project and places the files into the specified output folder. The command doesn't automatically clean the target folder before publishing the app.
59
+
60
+
To empty the target folder automatically before the app is published, add the following MSBuild target to the app's project file (`.csproj`) under the root `<Project>` element:
# ASP.NET Core Blazor WebAssembly runtime performance
12
+
13
+
<!-- UPDATE 10.0 - Activate ...
14
+
15
+
[!INCLUDE[](~/includes/not-latest-version.md)]
16
+
17
+
-->
18
+
19
+
This article provides guidance on Blazor WebAssembly runtime performance.
20
+
21
+
## Potentially reduced performance with Microsoft Edge enhanced security
22
+
23
+
The Microsoft Edge browser's WebAssembly (WASM) interpreter running in [enhanced security mode](/DeployEdge/microsoft-edge-security-browse-safer) might not yield the same performance as when Blazor is running without enhanced security. If enhanced security mode is enabled and an app's performance is degraded, we recommend adding the site as an [exception](/DeployEdge/microsoft-edge-security-browse-safer#enhanced-security-sites) to opt out of enhanced security mode.
24
+
25
+
:::moniker range=">= aspnetcore-8.0"
26
+
27
+
## Trim .NET IL after ahead-of-time (AOT) compilation
28
+
29
+
The `WasmStripILAfterAOT` MSBuild option enables removing the .NET Intermediate Language (IL) for compiled methods after performing AOT compilation to WebAssembly, which reduces the size of the `_framework` folder.
30
+
31
+
In the app's project file:
32
+
33
+
```xml
34
+
<PropertyGroup>
35
+
<RunAOTCompilation>true</RunAOTCompilation>
36
+
<WasmStripILAfterAOT>true</WasmStripILAfterAOT>
37
+
</PropertyGroup>
38
+
```
39
+
40
+
This setting trims away the IL code for most compiled methods, including methods from libraries and methods in the app. Not all compiled methods can be trimmed, as some are still required by the .NET interpreter at runtime.
41
+
42
+
To report a problem with the trimming option, [open an issue on the `dotnet/runtime` GitHub repository](https://github.com/dotnet/runtime/issues).
43
+
44
+
Disable the trimming property if it prevents your app from running normally:
45
+
46
+
```xml
47
+
<WasmStripILAfterAOT>false</WasmStripILAfterAOT>
48
+
```
49
+
50
+
:::moniker-end
51
+
52
+
## Heap size for some mobile device browsers
53
+
54
+
When building a Blazor app that runs on the client and targets mobile device browsers, especially Safari on iOS, decreasing the maximum memory for the app with the MSBuild property `EmccMaximumHeapSize` may be required. For more information, see <xref:blazor/host-and-deploy/webassembly/index#decrease-maximum-heap-size-for-some-mobile-device-browsers>.
55
+
56
+
## Runtime relinking
57
+
58
+
One of the largest parts of a Blazor WebAssembly app is the WebAssembly-based .NET runtime (`dotnet.wasm`) that the browser must download when the app is first accessed by a user's browser. Relinking the .NET WebAssembly runtime trims unused runtime code and thus improves download speed.
59
+
60
+
Runtime relinking requires installation of the .NET WebAssembly build tools. For more information, see <xref:blazor/tooling#net-webassembly-build-tools>.
61
+
62
+
With the .NET WebAssembly build tools installed, runtime relinking is performed automatically when an app is **published** in the `Release` configuration. The size reduction is particularly dramatic when disabling globalization. For more information, see <xref:blazor/globalization-localization#invariant-globalization>.
63
+
64
+
> [!IMPORTANT]
65
+
> Runtime relinking trims class instance JavaScript-invokable .NET methods unless they're protected. For more information, see <xref:blazor/js-interop/call-dotnet-from-javascript#avoid-trimming-javascript-invokable-net-methods>.
66
+
67
+
## Single Instruction, Multiple Data (SIMD)
68
+
69
+
:::moniker range=">= aspnetcore-8.0"
70
+
71
+
Blazor uses [WebAssembly Single Instruction, Multiple Data (SIMD)](https://wikipedia.org/wiki/Single_instruction,_multiple_data) to improve the throughput of vectorized computations by performing an operation on multiple pieces of data in parallel using a single instruction.
72
+
73
+
To disable SIMD, for example when targeting old browsers or browsers on mobile devices that don't support SIMD, set the `<WasmEnableSIMD>` property to `false` in the app's project file (`.csproj`):
74
+
75
+
```xml
76
+
<PropertyGroup>
77
+
<WasmEnableSIMD>false</WasmEnableSIMD>
78
+
</PropertyGroup>
79
+
```
80
+
81
+
For more information, see [Configuring and hosting .NET WebAssembly applications: SIMD - Single instruction, multiple data](https://aka.ms/dotnet-wasm-features#simd---single-instruction-multiple-data) and note that the guidance isn't versioned and applies to the latest public release.
82
+
83
+
:::moniker-end
84
+
85
+
:::moniker range="< aspnetcore-8.0"
86
+
87
+
Blazor uses [WebAssembly Single Instruction, Multiple Data (SIMD)](https://wikipedia.org/wiki/Single_instruction,_multiple_data) to improve the throughput of vectorized computations by performing an operation on multiple pieces of data in parallel using a single instruction.
88
+
89
+
To enable SIMD, add the `<WasmEnableSIMD>` property set to `true` in the app's project file (`.csproj`):
90
+
91
+
```xml
92
+
<PropertyGroup>
93
+
<WasmEnableSIMD>true</WasmEnableSIMD>
94
+
</PropertyGroup>
95
+
```
96
+
97
+
For more information, see [Configuring and hosting .NET WebAssembly applications: SIMD - Single instruction, multiple data](https://aka.ms/dotnet-wasm-features#simd---single-instruction-multiple-data) and note that the guidance isn't versioned and applies to the latest public release.
Copy file name to clipboardExpand all lines: aspnetcore/blazor/webassembly-build-tools-and-aot.md
+7-75Lines changed: 7 additions & 75 deletions
Original file line number
Diff line number
Diff line change
@@ -14,8 +14,6 @@ uid: blazor/tooling/webassembly
14
14
15
15
This article describes the build tools for standalone Blazor WebAssembly apps and how to compile an app ahead of deployment with ahead-of-time (AOT) compilation.
16
16
17
-
Although the article primarily focuses on standalone Blazor WebAssembly apps, the section on [heap size for some mobile device browsers](#heap-size-for-some-mobile-device-browsers) also applies to the client-side project (`.Client`) of a Blazor Web App.
18
-
19
17
## .NET WebAssembly build tools
20
18
21
19
The .NET WebAssembly build tools are based on [Emscripten](https://emscripten.org/), a compiler toolchain for the web platform. To install the build tools, use ***either*** of the following approaches:
@@ -80,81 +78,14 @@ The size of an AOT-compiled Blazor WebAssembly app is generally larger than the
80
78
> [!NOTE]
81
79
> For [Mono](https://github.com/mono/mono)/WebAssembly MSBuild properties and targets, see [`WasmApp.Common.targets` (`dotnet/runtime` GitHub repository)](https://github.com/dotnet/runtime/blob/main/src/mono/wasm/build/WasmApp.Common.targets). Official documentation for common MSBuild properties is planned per [Document blazor msbuild configuration options (`dotnet/docs`#27395)](https://github.com/dotnet/docs/issues/27395).
82
80
83
-
:::moniker range=">= aspnetcore-8.0"
84
-
85
-
## Trim .NET IL after ahead-of-time (AOT) compilation
86
-
87
-
The `WasmStripILAfterAOT` MSBuild option enables removing the .NET Intermediate Language (IL) for compiled methods after performing AOT compilation to WebAssembly, which reduces the size of the `_framework` folder.
88
-
89
-
In the app's project file:
90
-
91
-
```xml
92
-
<PropertyGroup>
93
-
<RunAOTCompilation>true</RunAOTCompilation>
94
-
<WasmStripILAfterAOT>true</WasmStripILAfterAOT>
95
-
</PropertyGroup>
96
-
```
97
-
98
-
This setting trims away the IL code for most compiled methods, including methods from libraries and methods in the app. Not all compiled methods can be trimmed, as some are still required by the .NET interpreter at runtime.
99
-
100
-
To report a problem with the trimming option, [open an issue on the `dotnet/runtime` GitHub repository](https://github.com/dotnet/runtime/issues).
101
-
102
-
Disable the trimming property if it prevents your app from running normally:
103
-
104
-
```xml
105
-
<WasmStripILAfterAOT>false</WasmStripILAfterAOT>
106
-
```
107
-
108
-
:::moniker-end
109
-
110
-
## Heap size for some mobile device browsers
111
-
112
-
When building a Blazor app that runs on the client and targets mobile device browsers, especially Safari on iOS, decreasing the maximum memory for the app with the MSBuild property `EmccMaximumHeapSize` may be required. For more information, see <xref:blazor/host-and-deploy/webassembly/index#decrease-maximum-heap-size-for-some-mobile-device-browsers>.
113
-
114
-
## Runtime relinking
115
-
116
-
One of the largest parts of a Blazor WebAssembly app is the WebAssembly-based .NET runtime (`dotnet.wasm`) that the browser must download when the app is first accessed by a user's browser. Relinking the .NET WebAssembly runtime trims unused runtime code and thus improves download speed.
117
-
118
-
Runtime relinking requires installation of the .NET WebAssembly build tools. For more information, see <xref:blazor/tooling#net-webassembly-build-tools>.
119
-
120
-
With the .NET WebAssembly build tools installed, runtime relinking is performed automatically when an app is **published** in the `Release` configuration. The size reduction is particularly dramatic when disabling globalization. For more information, see <xref:blazor/globalization-localization#invariant-globalization>.
81
+
## Performance
121
82
122
-
> [!IMPORTANT]
123
-
> Runtime relinking trims class instance JavaScript-invokable .NET methods unless they're protected. For more information, see <xref:blazor/js-interop/call-dotnet-from-javascript#avoid-trimming-javascript-invokable-net-methods>.
83
+
For performance guidance, see <xref:blazor/performance/webassembly-runtime-performance>:
124
84
125
-
## Single Instruction, Multiple Data (SIMD)
126
-
127
-
:::moniker range=">= aspnetcore-8.0"
128
-
129
-
Blazor uses [WebAssembly Single Instruction, Multiple Data (SIMD)](https://wikipedia.org/wiki/Single_instruction,_multiple_data) to improve the throughput of vectorized computations by performing an operation on multiple pieces of data in parallel using a single instruction.
130
-
131
-
To disable SIMD, for example when targeting old browsers or browsers on mobile devices that don't support SIMD, set the `<WasmEnableSIMD>` property to `false` in the app's project file (`.csproj`):
132
-
133
-
```xml
134
-
<PropertyGroup>
135
-
<WasmEnableSIMD>false</WasmEnableSIMD>
136
-
</PropertyGroup>
137
-
```
138
-
139
-
For more information, see [Configuring and hosting .NET WebAssembly applications: SIMD - Single instruction, multiple data](https://aka.ms/dotnet-wasm-features#simd---single-instruction-multiple-data) and note that the guidance isn't versioned and applies to the latest public release.
140
-
141
-
:::moniker-end
142
-
143
-
:::moniker range="< aspnetcore-8.0"
144
-
145
-
Blazor uses [WebAssembly Single Instruction, Multiple Data (SIMD)](https://wikipedia.org/wiki/Single_instruction,_multiple_data) to improve the throughput of vectorized computations by performing an operation on multiple pieces of data in parallel using a single instruction.
146
-
147
-
To enable SIMD, add the `<WasmEnableSIMD>` property set to `true` in the app's project file (`.csproj`):
148
-
149
-
```xml
150
-
<PropertyGroup>
151
-
<WasmEnableSIMD>true</WasmEnableSIMD>
152
-
</PropertyGroup>
153
-
```
154
-
155
-
For more information, see [Configuring and hosting .NET WebAssembly applications: SIMD - Single instruction, multiple data](https://aka.ms/dotnet-wasm-features#simd---single-instruction-multiple-data) and note that the guidance isn't versioned and applies to the latest public release.
156
-
157
-
:::moniker-end
85
+
* Heap size for some mobile device browsers
86
+
* Runtime relinking
87
+
* Single Instruction, Multiple Data (SIMD)
88
+
* Trim .NET IL after ahead-of-time (AOT) compilation (.NET 8 or later)
158
89
159
90
## Exception handling
160
91
@@ -189,5 +120,6 @@ For more information, see the following resources:
Copy file name to clipboardExpand all lines: aspnetcore/log-mon/metrics/built-in.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -115,7 +115,7 @@ The `Microsoft.AspNetCore.Hosting` metrics report high-level information about H
115
115
116
116
Name | Instrument Type | Unit (UCUM) | Description
117
117
--- | --- | --- | ---
118
-
[`http.server.request.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-httpclientrequestduration) | Histogram | `s` | Measures the duration of inbound HTTP requests.
118
+
[`http.server.request.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-httpserverrequestduration) | Histogram | `s` | Measures the duration of inbound HTTP requests.
119
119
120
120
Attribute | Type | Description | Examples | Presence
121
121
--- |--- | --- | --- | ---
@@ -144,7 +144,7 @@ When using OpenTelemetry, the default buckets for this metric are set to [ 0.005
144
144
145
145
Name | Instrument Type | Unit (UCUM) | Description
146
146
--- | --- | --- | ---
147
-
[`http.server.active_requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-httpclientactive_requests) | UpDownCounter | `{request}` | Measures the number of concurrent HTTP requests that are currently in-flight.
147
+
[`http.server.active_requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-httpserveractive_requests) | UpDownCounter | `{request}` | Measures the number of concurrent HTTP requests that are currently in-flight.
148
148
149
149
Attribute | Type | Description | Examples | Presence
Copy file name to clipboardExpand all lines: aspnetcore/security/authentication/social/facebook-logins.md
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -134,9 +134,7 @@ We recommend the `AccessDeniedPath` page contains the following information:
134
134
<!-- End of React -->
135
135
[!INCLUDE[Forward request information when behind a proxy or load balancer section](includes/forwarded-headers-middleware.md)]
136
136
137
-
[!INCLUDE[](includes/chain-auth-providers.md)]
138
-
139
-
For more information on configuration options supported by Facebook authentication, see the <xref:Microsoft.AspNetCore.Builder.FacebookOptions> API reference. Configuration options can be used to:
137
+
For more information on configuration options supported by Facebook authentication, see the <xref:Microsoft.AspNetCore.Builder.FacebookOptions> API reference. Configuration options can be used to:
140
138
141
139
* Request different information about the user.
142
140
* Add query string arguments to customize the login experience.
@@ -153,3 +151,7 @@ We recommend the `AccessDeniedPath` page contains the following information:
153
151
* Once you publish your web site to Azure web app, you should reset the `AppSecret` in the Facebook developer portal.
154
152
155
153
* Set the `Authentication:Facebook:AppId` and `Authentication:Facebook:AppSecret` as application settings in the Azure portal. The configuration system is set up to read keys from environment variables.
Copy file name to clipboardExpand all lines: aspnetcore/security/authentication/social/google-logins.md
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -117,3 +117,7 @@ The user is now logged in using Google credentials.
117
117
* This article demonstrates authentication with Google. For information on authenticating with other external providers, see <xref:security/authentication/social/index>.
118
118
* After the app is deployed to Azure, reset the `ClientSecret` in the Google API console.
119
119
* Set the `Authentication:Google:ClientId` and `Authentication:Google:ClientSecret` as app settings in the Azure portal. The configuration system is set up to read keys from the environment variables.
0 commit comments