diff --git a/aspnetcore/blazor/host-and-deploy/webassembly.md b/aspnetcore/blazor/host-and-deploy/webassembly.md index 3bd9b0391954..da5b2f6acb29 100644 --- a/aspnetcore/blazor/host-and-deploy/webassembly.md +++ b/aspnetcore/blazor/host-and-deploy/webassembly.md @@ -775,7 +775,7 @@ If you confirm that the server is returning plausibly correct data, there must b ### Troubleshoot integrity PowerShell script -Use the [`integrity.ps1`](https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/host-and-deploy/webassembly/_samples/integrity.ps1?raw=true) PowerShell script to validate a published and deployed Blazor app. The script is provided for PowerShell Core 6 as a starting point when the app has integrity issues that the Blazor framework can't identify. Customization of the script might be required for your apps, including if running on version of PowerShell later than version 6.2.7. +Use the [`integrity.ps1`](https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/host-and-deploy/webassembly/_samples/integrity.ps1?raw=true) PowerShell script to validate a published and deployed Blazor app. The script is provided for PowerShell Core 7 or later as a starting point when the app has integrity issues that the Blazor framework can't identify. Customization of the script might be required for your apps, including if running on version of PowerShell later than version 7.2.0. The script checks the files in the `publish` folder and downloaded from the deployed app to detect issues in the different manifests that contain integrity hashes. These checks should detect the most common problems: @@ -789,9 +789,15 @@ Invoke the script with the following command in a PowerShell command shell: .\integrity.ps1 {BASE URL} {PUBLISH OUTPUT FOLDER} ``` +In the following example, the script is executed on a locally-running app at `https://localhost:5001/`: + +```powershell +.\integrity.ps1 https://localhost:5001/ C:\TestApps\BlazorSample\bin\Release\net6.0\publish\ +``` + Placeholders: -* `{BASE URL}`: The URL of the deployed app. +* `{BASE URL}`: The URL of the deployed app. A trailing slash (`/`) is required. * `{PUBLISH OUTPUT FOLDER}`: The path to the app's `publish` folder or location where the app is published for deployment. > [!NOTE] @@ -805,8 +811,8 @@ Placeholders: > > Comparing the checksum of a file to a valid checksum value doesn't guarantee file safety, but modifying a file in a way that maintains a checksum value isn't trivial for malicious users. Therefore, checksums are useful as a general security approach. Compare the checksum of the local `integrity.ps1` file to one of the following values: > -> * SHA256: `6b0dc7aba5d8489136bb2969036432597615b11b4e432535e173ca077a0449c4` -> * MD5: `f0c800a4c72604bd47f3c19f5f0bb4f4` +> * SHA256: `32c24cb667d79a701135cb72f6bae490d81703323f61b8af2c7e5e5dc0f0c2bb` +> * MD5: `9cee7d7ec86ee809a329b5406fbf21a8` > > Obtain the file's checksum on Windows OS with the following command. Provide the path and file name for the `{PATH AND FILE NAME}` placeholder and indicate the type of checksum to produce for the `{SHA512|MD5}` placeholder, either `SHA256` or `MD5`: > @@ -1594,7 +1600,7 @@ If you confirm that the server is returning plausibly correct data, there must b ### Troubleshoot integrity PowerShell script -Use the [`integrity.ps1`](https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/host-and-deploy/webassembly/_samples/integrity.ps1?raw=true) PowerShell script to validate a published and deployed Blazor app. The script is provided for PowerShell Core 6 as a starting point when the app has integrity issues that the Blazor framework can't identify. Customization of the script might be required for your apps, including if running on version of PowerShell later than version 6.2.7. +Use the [`integrity.ps1`](https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/host-and-deploy/webassembly/_samples/integrity.ps1?raw=true) PowerShell script to validate a published and deployed Blazor app. The script is provided for PowerShell Core 7 or later as a starting point when the app has integrity issues that the Blazor framework can't identify. Customization of the script might be required for your apps, including if running on version of PowerShell later than version 7.2.0. The script checks the files in the `publish` folder and downloaded from the deployed app to detect issues in the different manifests that contain integrity hashes. These checks should detect the most common problems: @@ -1608,9 +1614,15 @@ Invoke the script with the following command in a PowerShell command shell: .\integrity.ps1 {BASE URL} {PUBLISH OUTPUT FOLDER} ``` +In the following example, the script is executed on a locally-running app at `https://localhost:5001/`: + +```powershell +.\integrity.ps1 https://localhost:5001/ C:\TestApps\BlazorSample\bin\Release\net6.0\publish\ +``` + Placeholders: -* `{BASE URL}`: The URL of the deployed app. +* `{BASE URL}`: The URL of the deployed app. A trailing slash (`/`) is required. * `{PUBLISH OUTPUT FOLDER}`: The path to the app's `publish` folder or location where the app is published for deployment. > [!NOTE] @@ -1624,8 +1636,8 @@ Placeholders: > > Comparing the checksum of a file to a valid checksum value doesn't guarantee file safety, but modifying a file in a way that maintains a checksum value isn't trivial for malicious users. Therefore, checksums are useful as a general security approach. Compare the checksum of the local `integrity.ps1` file to one of the following values: > -> * SHA256: `6b0dc7aba5d8489136bb2969036432597615b11b4e432535e173ca077a0449c4` -> * MD5: `f0c800a4c72604bd47f3c19f5f0bb4f4` +> * SHA256: `32c24cb667d79a701135cb72f6bae490d81703323f61b8af2c7e5e5dc0f0c2bb` +> * MD5: `9cee7d7ec86ee809a329b5406fbf21a8` > > Obtain the file's checksum on Windows OS with the following command. Provide the path and file name for the `{PATH AND FILE NAME}` placeholder and indicate the type of checksum to produce for the `{SHA512|MD5}` placeholder, either `SHA256` or `MD5`: > @@ -2413,7 +2425,7 @@ If you confirm that the server is returning plausibly correct data, there must b ### Troubleshoot integrity PowerShell script -Use the [`integrity.ps1`](https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/host-and-deploy/webassembly/_samples/integrity.ps1?raw=true) PowerShell script to validate a published and deployed Blazor app. The script is provided for PowerShell Core 6 as a starting point when the app has integrity issues that the Blazor framework can't identify. Customization of the script might be required for your apps, including if running on version of PowerShell later than version 6.2.7. +Use the [`integrity.ps1`](https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/host-and-deploy/webassembly/_samples/integrity.ps1?raw=true) PowerShell script to validate a published and deployed Blazor app. The script is provided for PowerShell Core 7 or later as a starting point when the app has integrity issues that the Blazor framework can't identify. Customization of the script might be required for your apps, including if running on version of PowerShell later than version 7.2.0. The script checks the files in the `publish` folder and downloaded from the deployed app to detect issues in the different manifests that contain integrity hashes. These checks should detect the most common problems: @@ -2427,9 +2439,15 @@ Invoke the script with the following command in a PowerShell command shell: .\integrity.ps1 {BASE URL} {PUBLISH OUTPUT FOLDER} ``` +In the following example, the script is executed on a locally-running app at `https://localhost:5001/`: + +```powershell +.\integrity.ps1 https://localhost:5001/ C:\TestApps\BlazorSample\bin\Release\net6.0\publish\ +``` + Placeholders: -* `{BASE URL}`: The URL of the deployed app. +* `{BASE URL}`: The URL of the deployed app. A trailing slash (`/`) is required. * `{PUBLISH OUTPUT FOLDER}`: The path to the app's `publish` folder or location where the app is published for deployment. > [!NOTE] @@ -2443,8 +2461,8 @@ Placeholders: > > Comparing the checksum of a file to a valid checksum value doesn't guarantee file safety, but modifying a file in a way that maintains a checksum value isn't trivial for malicious users. Therefore, checksums are useful as a general security approach. Compare the checksum of the local `integrity.ps1` file to one of the following values: > -> * SHA256: `6b0dc7aba5d8489136bb2969036432597615b11b4e432535e173ca077a0449c4` -> * MD5: `f0c800a4c72604bd47f3c19f5f0bb4f4` +> * SHA256: `32c24cb667d79a701135cb72f6bae490d81703323f61b8af2c7e5e5dc0f0c2bb` +> * MD5: `9cee7d7ec86ee809a329b5406fbf21a8` > > Obtain the file's checksum on Windows OS with the following command. Provide the path and file name for the `{PATH AND FILE NAME}` placeholder and indicate the type of checksum to produce for the `{SHA512|MD5}` placeholder, either `SHA256` or `MD5`: > diff --git a/aspnetcore/blazor/host-and-deploy/webassembly/_samples/integrity.ps1 b/aspnetcore/blazor/host-and-deploy/webassembly/_samples/integrity.ps1 index d451d382e62e..685a37a1af33 100644 --- a/aspnetcore/blazor/host-and-deploy/webassembly/_samples/integrity.ps1 +++ b/aspnetcore/blazor/host-and-deploy/webassembly/_samples/integrity.ps1 @@ -31,7 +31,7 @@ function Test-BlazorApplication { $result = [ValidationErrors]::new(); $result.ComparisonErrors = $errors; $result.DownloadedAppErrors = $web; - $result.PublishedAppErrors = $res; + $result.PublishedAppErrors = $res.Errors; $result.PublishedApp = $res; $result.DownloadedApp = $web; @@ -40,7 +40,7 @@ function Test-BlazorApplication { } else { if ($result.IsValid()) { - "No error founds. Application is consistent." + "No errors found. Application is consistent." } else { foreach ($publishError in $result.PublishedAppErrors) { diff --git a/aspnetcore/fundamentals/configuration/index/samples/6.x/ConfigSample/ConfigSample.csproj b/aspnetcore/fundamentals/configuration/index/samples/6.x/ConfigSample/ConfigSample.csproj index 10f6eb462877..9a214e2071c1 100644 --- a/aspnetcore/fundamentals/configuration/index/samples/6.x/ConfigSample/ConfigSample.csproj +++ b/aspnetcore/fundamentals/configuration/index/samples/6.x/ConfigSample/ConfigSample.csproj @@ -3,6 +3,7 @@ net6.0 enable + enable diff --git a/aspnetcore/fundamentals/configuration/index/samples/6.x/ConfigSample/Pages/Test22.cshtml.cs b/aspnetcore/fundamentals/configuration/index/samples/6.x/ConfigSample/Pages/Test22.cshtml.cs index 0c1893bd86b4..a24400155a25 100644 --- a/aspnetcore/fundamentals/configuration/index/samples/6.x/ConfigSample/Pages/Test22.cshtml.cs +++ b/aspnetcore/fundamentals/configuration/index/samples/6.x/ConfigSample/Pages/Test22.cshtml.cs @@ -1,7 +1,6 @@ using ConfigSample.Options; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; -using System.Diagnostics; namespace ConfigSample.Pages {