From 73176f390d35ee81a53ccf79570ceaec3adfedde Mon Sep 17 00:00:00 2001 From: Wade Pickett Date: Mon, 21 Apr 2025 15:11:36 -0700 Subject: [PATCH 01/10] Overview: Blazor over Razor Pages (#35149) * Overview: Blazor over Razor Pages * Update aspnetcore/introduction-to-aspnet-core.md Co-authored-by: Luke Latham <1622880+guardrex@users.noreply.github.com> * Added Get Started with Blazor link on next steps --------- Co-authored-by: Luke Latham <1622880+guardrex@users.noreply.github.com> --- aspnetcore/includes/benefits.md | 2 +- aspnetcore/introduction-to-aspnet-core.md | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/aspnetcore/includes/benefits.md b/aspnetcore/includes/benefits.md index 000225adcacb..e0d9d996a000 100644 --- a/aspnetcore/includes/benefits.md +++ b/aspnetcore/includes/benefits.md @@ -2,8 +2,8 @@ ASP.NET Core provides the following benefits: * A unified story for building web UI and web APIs. * Architected for testability. -* [Razor Pages](xref:razor-pages/index) makes coding page-focused scenarios easier and more productive. * [Blazor](xref:blazor/index) lets you use C# in the browser alongside JavaScript. Share server-side and client-side app logic all written with .NET. +* [Razor Pages](xref:razor-pages/index) makes coding page-focused scenarios easier and more productive. * Ability to develop and run on Windows, macOS, and Linux. * Open-source and [community-focused](https://live.asp.net/). * Integration of [modern, client-side frameworks](xref:blazor/index) and development workflows. diff --git a/aspnetcore/introduction-to-aspnet-core.md b/aspnetcore/introduction-to-aspnet-core.md index 8164ec9a0994..001139f2c2bf 100644 --- a/aspnetcore/introduction-to-aspnet-core.md +++ b/aspnetcore/introduction-to-aspnet-core.md @@ -4,7 +4,7 @@ author: tdykstra description: Get an overview of ASP.NET Core, a cross-platform, high-performance, open-source framework for building modern, cloud-enabled, Internet-connected apps. ms.author: tdykstra ms.custom: mvc -ms.date: 10/03/2023 +ms.date: 04/21/2025 uid: index --- # Overview of ASP.NET Core @@ -15,7 +15,7 @@ By [Daniel Roth](https://github.com/danroth27), [Rick Anderson](https://twitter. :::moniker range=">= aspnetcore-3.0" -ASP.NET Core is a cross-platform, high-performance, [open-source](https://github.com/dotnet/aspnetcore) framework for building modern, cloud-enabled, Internet-connected apps. +ASP.NET Core is a cross-platform, high-performance framework for building modern web applications. This [open-source](https://github.com/dotnet/aspnetcore) framework allows developers to create web applications, services, and APIs that can run on Windows, macOS, and Linux. It is built for large-scale app development and can handle any size workload, making it a robust choice for enterprise-level applications. With ASP.NET Core, you can: @@ -32,9 +32,10 @@ Millions of developers use or have used [ASP.NET 4.x](/aspnet/overview) to creat ## Build web APIs and web UI using ASP.NET Core MVC -ASP.NET Core MVC provides features to build [web APIs](xref:tutorials/first-web-api) and [web apps](xref:tutorials/razor-pages/index): +ASP.NET Core MVC provides features to build [web APIs](xref:tutorials/first-web-api) and [web apps](https://dotnet.microsoft.com/learn/aspnet/blazor-tutorial/intro): * The [Model-View-Controller (MVC) pattern](xref:mvc/overview) helps make your web APIs and web apps testable. +* [Blazor](xref:blazor/index), a component-based web UI framework based on C# that supports both server-side rendering and client-side rendering via WebAssembly. * [Razor Pages](xref:razor-pages/index) is a page-based programming model that makes building web UI easier and more productive. * [Razor markup](xref:mvc/views/razor) provides a productive syntax for [Razor Pages](xref:razor-pages/index) and [MVC views](xref:mvc/views/overview). * [Tag Helpers](xref:mvc/views/tag-helpers/intro) enable server-side code to participate in creating and rendering HTML elements in Razor files. @@ -68,9 +69,9 @@ We recommend the following sequence of tutorials for an introduction to developi |App type |Scenario |Tutorial | |----------|----------|----------| + |Web app | Client-side web UI development |[Get started with Blazor](https://dotnet.microsoft.com/learn/aspnet/blazor-tutorial/intro) | |Web app | New server-side web UI development |[Get started with Razor Pages](xref:tutorials/razor-pages/razor-pages-start) | |Web app | Maintaining an MVC app |[Get started with MVC](xref:tutorials/first-mvc-app/start-mvc)| - |Web app | Client-side web UI development |[Get started with Blazor](https://dotnet.microsoft.com/learn/aspnet/blazor-tutorial/intro) | |Web API | RESTful HTTP services |[Create a web API](xref:tutorials/first-web-api)† | |Remote Procedure Call app | Contract-first services using Protocol Buffers |[Get started with a gRPC service](xref:tutorials/grpc/grpc-start) | |Real-time app | Bidirectional communication between servers and connected clients |[Get started with SignalR](xref:tutorials/signalr) | @@ -79,6 +80,7 @@ We recommend the following sequence of tutorials for an introduction to developi |Scenario |Tutorial | |----------|----------| + |New development |[Blazor with Entity Framework Core](xref:blazor/tutorials/movie-database-app/index) | |New development |[Razor Pages with Entity Framework Core](xref:data/ef-rp/intro) | |Maintaining an MVC app |[MVC with Entity Framework Core](xref:data/ef-mvc/intro) | @@ -240,6 +242,7 @@ For more information, see [Contribute to the ASP.NET documentation: Code snippet For more information, see the following resources: +* [Get started with Blazor](https://dotnet.microsoft.com/learn/aspnet/blazor-tutorial/intro) * * * [ASP.NET Core fundamentals](xref:fundamentals/index) From 714aecf87df3730e021e936d743c50f8317cb114 Mon Sep 17 00:00:00 2001 From: Wade Pickett Date: Mon, 21 Apr 2025 16:37:39 -0700 Subject: [PATCH 02/10] Prep only: .NET 10 update: Run in Docker Container (#35281) Prep only for include file. --- .../docker/building-net-docker-images.md | 1 + .../includes/building-net-docker-images10.md | 171 ++++++++++++++++++ .../includes/building-net-docker-images9.md | 2 +- 3 files changed, 173 insertions(+), 1 deletion(-) create mode 100644 aspnetcore/host-and-deploy/docker/includes/building-net-docker-images10.md diff --git a/aspnetcore/host-and-deploy/docker/building-net-docker-images.md b/aspnetcore/host-and-deploy/docker/building-net-docker-images.md index dbbfeb54538c..371860f133bd 100644 --- a/aspnetcore/host-and-deploy/docker/building-net-docker-images.md +++ b/aspnetcore/host-and-deploy/docker/building-net-docker-images.md @@ -18,6 +18,7 @@ Windows Home Edition doesn't support Hyper-V, and Hyper-V is needed for Docker. See [Containerize a .NET app with dotnet publish](/dotnet/core/docker/publish-as-container) for information on containerized a .NET app with `dotnet publish`. +[!INCLUDE[](~/host-and-deploy/docker/includes/building-net-docker-images10.md)] [!INCLUDE[](~/host-and-deploy/docker/includes/building-net-docker-images9.md)] [!INCLUDE[](~/host-and-deploy/docker/includes/building-net-docker-images8.md)] [!INCLUDE[](~/host-and-deploy/docker/includes/building-net-docker-images7.md)] diff --git a/aspnetcore/host-and-deploy/docker/includes/building-net-docker-images10.md b/aspnetcore/host-and-deploy/docker/includes/building-net-docker-images10.md new file mode 100644 index 000000000000..b3e58f8b0d56 --- /dev/null +++ b/aspnetcore/host-and-deploy/docker/includes/building-net-docker-images10.md @@ -0,0 +1,171 @@ +:::moniker range=">= aspnetcore-10.0" + +## ASP.NET Core Docker images + +For this tutorial, you download an ASP.NET Core sample app and run it in Docker containers. The sample works with both Linux and Windows containers. + +The sample Dockerfile uses the [Docker multi-stage build feature](https://docs.docker.com/engine/userguide/eng-image/multistage-build/) to build and run in different containers. The build and run containers are created from images that are provided in Docker Hub by Microsoft: + +* `dotnet/sdk` + + The sample uses this image for building the app. The image contains the .NET SDK, which includes the Command Line Tools (CLI). The image is optimized for local development, debugging, and unit testing. The tools installed for development and compilation make the image relatively large. + +* `dotnet/aspnet` + + The sample uses this image for running the app. The image contains the ASP.NET Core runtime and libraries and is optimized for running apps in production. Designed for speed of deployment and app startup, the image is relatively small, so network performance from Docker Registry to Docker host is optimized. Only the binaries and content needed to run an app are copied to the container. The contents are ready to run, enabling the fastest time from `docker run` to app startup. Dynamic code compilation isn't needed in the Docker model. + +## Prerequisites + +* [.NET SDK 9.0](https://dotnet.microsoft.com/download) +* Docker client 18.03 or later + + * Linux distributions + * [Debian](https://docs.docker.com/install/linux/docker-ce/debian/) + * [Fedora](https://docs.docker.com/install/linux/docker-ce/fedora/) + * [Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/) + * [macOS](https://docs.docker.com/desktop/mac/install/) + * [Windows](https://docs.docker.com/desktop/windows/install/) + +* [Git](https://git-scm.com/download) + +## Download the sample app + +* Download the sample by cloning the [.NET Docker repository](https://github.com/dotnet/dotnet-docker): + + ```console + git clone https://github.com/dotnet/dotnet-docker + ``` + +## Run the app locally + +* Navigate to the project folder at *dotnet-docker/samples/aspnetapp/aspnetapp*. + +* Run the following command to build and run the app locally: + + ```dotnetcli + dotnet run + ``` + +* Go to `http://localhost:` in a browser to test the app. + +* Press Ctrl+C at the command prompt to stop the app. + +## Run in a Linux container or Windows container + +* To run in a Linux container, right-click the System Tray's Docker client icon and select [switch to Linux containers](https://docs.docker.com/desktop/windows/#switch-between-windows-and-linux-containers). +* To run in a Windows container, right-click the System Tray's Docker client icon and select [switch to Windows containers](https://docs.docker.com/desktop/windows/#switch-between-windows-and-linux-containers). + +* Navigate to the Dockerfile folder at *dotnet-docker/samples/aspnetapp*. + +* Run the following commands to build and run the sample in Docker: + + ```console + docker build -t aspnetapp . + docker run -it --rm -p :8080 --name aspnetcore_sample aspnetapp + ``` + + The `build` command arguments: + * Name the image aspnetapp. + * Look for the Dockerfile in the current folder (the period at the end). + + The run command arguments: + * Allocate a pseudo-TTY and keep it open even if not attached. (Same effect as `--interactive --tty`.) + * Automatically remove the container when it exits. + * Map `` on the local machine to port 8080 in the container. + * Name the container aspnetcore_sample. + * Specify the aspnetapp image. + +* Go to `http://localhost:` in a browser to test the app. + +## Build and deploy manually + +In some scenarios, you might want to deploy an app to a container by copying its assets that are needed at run time. This section shows how to deploy manually. + +* Navigate to the project folder at *dotnet-docker/samples/aspnetapp/aspnetapp*. + +* Run the [dotnet publish](/dotnet/core/tools/dotnet-publish) command: + + ```dotnetcli + dotnet publish -c Release -o published + ``` + + The command arguments: + * Build the app in release mode (the default is debug mode). + * Create the assets in the *published* folder. + +* Run the app. + + * Windows: + + ```dotnetcli + dotnet published\aspnetapp.dll + ``` + + * Linux: + + ```dotnetcli + dotnet published/aspnetapp.dll + ``` + +* Browse to `http://localhost:` to see the home page. + +To use the manually published app within a Docker container, create a new *Dockerfile* and use the `docker build .` command to build an image. + +```dockerfile +FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime +WORKDIR /app +COPY published/ ./ +ENTRYPOINT ["dotnet", "aspnetapp.dll"] +``` + +To see the new image use the `docker images` command. + +### The Dockerfile + +Here's the *Dockerfile* used by the `docker build` command you ran earlier. It uses `dotnet publish` the same way you did in this section to build and deploy. + +```dockerfile +# https://hub.docker.com/_/microsoft-dotnet +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build +WORKDIR /source + +# copy csproj and restore as distinct layers +COPY *.sln . +COPY aspnetapp/*.csproj ./aspnetapp/ +RUN dotnet restore + +# copy everything else and build app +COPY aspnetapp/. ./aspnetapp/ +WORKDIR /source/aspnetapp +RUN dotnet publish -c release -o /app --no-restore + +# final stage/image +FROM mcr.microsoft.com/dotnet/aspnet:9.0 +WORKDIR /app +COPY --from=build /app ./ +ENTRYPOINT ["dotnet", "aspnetapp.dll"] +``` + +In the preceding *Dockerfile*, the `*.csproj` files are copied and restored as distinct *layers*. When the `docker build` command builds an image, it uses a built-in cache. If the `*.csproj` files haven't changed since the `docker build` command last ran, the `dotnet restore` command doesn't need to run again. Instead, the built-in cache for the corresponding `dotnet restore` layer is reused. For more information, see [Best practices for writing Dockerfiles](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache). + +## Additional resources + +* [Containerize a .NET app with dotnet publish](/dotnet/core/docker/publish-as-container) +* [Docker build command](https://docs.docker.com/engine/reference/commandline/build) +* [Docker run command](https://docs.docker.com/engine/reference/commandline/run) +* [ASP.NET Core Docker sample](https://github.com/dotnet/dotnet-docker) (The one used in this tutorial.) +* [Configure ASP.NET Core to work with proxy servers and load balancers](xref:host-and-deploy/proxy-load-balancer) +* [Working with Visual Studio Docker Tools](xref:host-and-deploy/docker/visual-studio-tools-for-docker) +* [Debugging with Visual Studio Code](https://code.visualstudio.com/docs/nodejs/debugging-recipes#_debug-nodejs-in-docker-containers) +* [GC using Docker and small containers](xref:performance/memory#sc) +* [System.IO.IOException: The configured user limit (128) on the number of inotify instances has been reached](xref:host-and-deploy/docker/index#d128) +* [Updates to Docker images](https://andrewlock.net/exploring-the-dotnet-8-preview-updates-to-docker-images-in-dotnet-8/) + +## Next steps + +The Git repository that contains the sample app also includes documentation. For an overview of the resources available in the repository, see [the README file](https://github.com/dotnet/dotnet-docker/blob/main/samples/aspnetapp/README.md). In particular, learn how to implement HTTPS: + +> [!div class="nextstepaction"] +> [Developing ASP.NET Core Applications with Docker over HTTPS](https://github.com/dotnet/dotnet-docker/blob/main/samples/run-aspnetcore-https-development.md) + +:::moniker-end diff --git a/aspnetcore/host-and-deploy/docker/includes/building-net-docker-images9.md b/aspnetcore/host-and-deploy/docker/includes/building-net-docker-images9.md index 0ebd03245c62..5c3e29071997 100644 --- a/aspnetcore/host-and-deploy/docker/includes/building-net-docker-images9.md +++ b/aspnetcore/host-and-deploy/docker/includes/building-net-docker-images9.md @@ -1,4 +1,4 @@ -:::moniker range=">= aspnetcore-9.0" +:::moniker range="= aspnetcore-9.0" ## ASP.NET Core Docker images From 25d5edfea246b741b2c760331732667bc4bf50b4 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 22 Apr 2025 11:11:56 -0600 Subject: [PATCH 03/10] replace old versions SDK with latest released /1 (#35269) * replace old versions SDK with latest released /1 * replace old versions SDK with latest released /1 * replace old versions SDK with latest released /1 * replace old versions SDK with latest released /1 * replace old versions SDK with latest released /1 * replace old versions SDK with latest released /1 --- aspnetcore/data/ef-rp/intro.md | 10 +++++----- aspnetcore/includes/0-latest-SDK.md | 1 + aspnetcore/includes/net-prereqs-vs-10-latest.md | 3 +++ aspnetcore/includes/net-prereqs-vs-9.0.md | 1 + aspnetcore/includes/net-prereqs-vs-latest.md | 3 +++ aspnetcore/includes/net-prereqs-vsc-10.0.md | 5 +++++ aspnetcore/includes/net-prereqs-vsc-latest.md | 5 +++++ 7 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 aspnetcore/includes/0-latest-SDK.md create mode 100644 aspnetcore/includes/net-prereqs-vs-10-latest.md create mode 100644 aspnetcore/includes/net-prereqs-vs-latest.md create mode 100644 aspnetcore/includes/net-prereqs-vsc-10.0.md create mode 100644 aspnetcore/includes/net-prereqs-vsc-latest.md diff --git a/aspnetcore/data/ef-rp/intro.md b/aspnetcore/data/ef-rp/intro.md index aa620fd3e261..21191d78f486 100644 --- a/aspnetcore/data/ef-rp/intro.md +++ b/aspnetcore/data/ef-rp/intro.md @@ -27,7 +27,7 @@ This is the first in a series of tutorials that show how to use Entity Framework # [Visual Studio](#tab/visual-studio) -[!INCLUDE[VS prereqs](~/includes/net-prereqs-vs-6.0.md)] +[!INCLUDE[VS prereqs](~/includes/net-prereqs-vs-latest.md)] ### Database engines @@ -559,7 +559,7 @@ This is the first in a series of tutorials that show how to use Entity Framework # [Visual Studio](#tab/visual-studio) -[!INCLUDE[VS prereqs](~/includes/net-core-prereqs-vs-5.0.md)] +[!INCLUDE[VS prereqs](~/includes/net-prereqs-vs-latest.md)] ### Database engines @@ -567,7 +567,7 @@ The Visual Studio instructions use [SQL Server LocalDB](/sql/database-engine/con # [Visual Studio Code](#tab/visual-studio-code) -[!INCLUDE[VS Code prereqs](~/includes/net-core-prereqs-vsc-5.0.md)] +[!INCLUDE[VS Code prereqs](~/includes/net-prereqs-vsc-latest.md)] Consider downloading and installing a third-party tool for managing and viewing a SQLite database, such as [DB Browser for SQLite](https://sqlitebrowser.org/). @@ -1073,11 +1073,11 @@ This is the first in a series of tutorials that show how to use Entity Framework # [Visual Studio](#tab/visual-studio) -[!INCLUDE[VS prereqs](~/includes/net-core-prereqs-vs-3.0.md)] +[!INCLUDE[VS prereqs](~/includes/net-prereqs-vs-latest.md)] # [Visual Studio Code](#tab/visual-studio-code) -[!INCLUDE[VS Code prereqs](~/includes/net-core-prereqs-vsc-3.0.md)] +[!INCLUDE[VS Code prereqs](~/includes/net-prereqs-vsc-latest.md)] --- diff --git a/aspnetcore/includes/0-latest-SDK.md b/aspnetcore/includes/0-latest-SDK.md new file mode 100644 index 000000000000..15762053ebb4 --- /dev/null +++ b/aspnetcore/includes/0-latest-SDK.md @@ -0,0 +1 @@ +[Latest released .NET Core SDK](https://dotnet.microsoft.com/download/dotnet-core) diff --git a/aspnetcore/includes/net-prereqs-vs-10-latest.md b/aspnetcore/includes/net-prereqs-vs-10-latest.md new file mode 100644 index 000000000000..11c7bf836918 --- /dev/null +++ b/aspnetcore/includes/net-prereqs-vs-10-latest.md @@ -0,0 +1,3 @@ +* [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/) with the **ASP.NET and web development** workload. + + ![VS22 installer workloads](~/tutorials/min-web-api/_static/asp-net-web-dev.png) diff --git a/aspnetcore/includes/net-prereqs-vs-9.0.md b/aspnetcore/includes/net-prereqs-vs-9.0.md index 11c7bf836918..bd5e4160d33e 100644 --- a/aspnetcore/includes/net-prereqs-vs-9.0.md +++ b/aspnetcore/includes/net-prereqs-vs-9.0.md @@ -1,3 +1,4 @@ + * [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/) with the **ASP.NET and web development** workload. ![VS22 installer workloads](~/tutorials/min-web-api/_static/asp-net-web-dev.png) diff --git a/aspnetcore/includes/net-prereqs-vs-latest.md b/aspnetcore/includes/net-prereqs-vs-latest.md new file mode 100644 index 000000000000..11c7bf836918 --- /dev/null +++ b/aspnetcore/includes/net-prereqs-vs-latest.md @@ -0,0 +1,3 @@ +* [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/) with the **ASP.NET and web development** workload. + + ![VS22 installer workloads](~/tutorials/min-web-api/_static/asp-net-web-dev.png) diff --git a/aspnetcore/includes/net-prereqs-vsc-10.0.md b/aspnetcore/includes/net-prereqs-vsc-10.0.md new file mode 100644 index 000000000000..888cf9d941df --- /dev/null +++ b/aspnetcore/includes/net-prereqs-vsc-10.0.md @@ -0,0 +1,5 @@ +* [Visual Studio Code](https://code.visualstudio.com/download) +* [C# Dev Kit for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit) +* [!INCLUDE [](~/includes/0-latest-SDK.md)] + +You can follow the Visual Studio Code instructions on macOS, Linux, or Windows. Changes may be required if you use an integrated development environment (IDE) other than Visual Studio Code. diff --git a/aspnetcore/includes/net-prereqs-vsc-latest.md b/aspnetcore/includes/net-prereqs-vsc-latest.md new file mode 100644 index 000000000000..888cf9d941df --- /dev/null +++ b/aspnetcore/includes/net-prereqs-vsc-latest.md @@ -0,0 +1,5 @@ +* [Visual Studio Code](https://code.visualstudio.com/download) +* [C# Dev Kit for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit) +* [!INCLUDE [](~/includes/0-latest-SDK.md)] + +You can follow the Visual Studio Code instructions on macOS, Linux, or Windows. Changes may be required if you use an integrated development environment (IDE) other than Visual Studio Code. From 776c9a5346cfa824dba16ab2c583c0a09d887be5 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Wed, 23 Apr 2025 06:52:42 -0400 Subject: [PATCH 04/10] [Pre4] Nix a couple of `dotnet.boot.js` file mentions (#35287) --- .../bundle-caching-and-integrity-check-failures.md | 2 +- aspnetcore/release-notes/aspnetcore-10/includes/blazor.md | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/aspnetcore/blazor/host-and-deploy/webassembly/bundle-caching-and-integrity-check-failures.md b/aspnetcore/blazor/host-and-deploy/webassembly/bundle-caching-and-integrity-check-failures.md index 1142d42602c4..a22db55eb483 100644 --- a/aspnetcore/blazor/host-and-deploy/webassembly/bundle-caching-and-integrity-check-failures.md +++ b/aspnetcore/blazor/host-and-deploy/webassembly/bundle-caching-and-integrity-check-failures.md @@ -20,7 +20,7 @@ When a Blazor WebAssembly app loads in the browser, the app downloads boot resou * .NET runtime and assemblies * Locale specific data -Except for Blazor's boot manifest file (`dotnet.boot.js` in .NET 10 or later, `blazor.boot.json` prior to .NET 10), WebAssembly .NET runtime and app bundle files are cached on clients. The Blazor boot configuration contains a manifest of the files that make up the app that must be downloaded along with a hash of the file's content that's used to detect whether any of the boot resources have changed. Blazor caches downloaded files using the browser [Cache](https://developer.mozilla.org/docs/Web/API/Cache) API. +Except for Blazor's boot manifest file (`blazor.boot.json` ) prior to the release of .NET 10, WebAssembly .NET runtime and app bundle files are cached on clients. The Blazor boot configuration, inlined into `dotnet.js` in .NET 10 or later, contains a manifest of the files that make up the app that must be downloaded along with a hash of the file's content that's used to detect whether any of the boot resources have changed. Blazor caches downloaded files using the browser [Cache](https://developer.mozilla.org/docs/Web/API/Cache) API. When Blazor WebAssembly downloads an app's startup files, it instructs the browser to perform integrity checks on the responses. Blazor sends SHA-256 hash values for DLL (`.dll`), WebAssembly (`.wasm`), and other files in the Blazor boot configuration, which isn't cached on clients. The file hashes of cached files are compared to the hashes in the Blazor boot configuration. For cached files with a matching hash, Blazor uses the cached files. Otherwise, files are requested from the server. After a file is downloaded, its hash is checked again for integrity validation. An error is generated by the browser if any downloaded file's integrity check fails. diff --git a/aspnetcore/release-notes/aspnetcore-10/includes/blazor.md b/aspnetcore/release-notes/aspnetcore-10/includes/blazor.md index ccf25f2e19d5..17b21543dd1a 100644 --- a/aspnetcore/release-notes/aspnetcore-10/includes/blazor.md +++ b/aspnetcore/release-notes/aspnetcore-10/includes/blazor.md @@ -194,13 +194,15 @@ The default environments are: * `Development` for build. * `Production` for publish. -### Boot configuration file name change +### Boot configuration file inlined -The boot configuration file is changing names from `blazor.boot.json` to `dotnet.boot.js`. This name change only affects developers who are interacting directly with the file, such as when developers are: +Blazor's boot configuration, which prior to the release of .NET 10 existed in a file named `blazor.boot.json`, has been inlined into the `dotnet.js` script. This only affects developers who are interacting directly with the `blazor.boot.json` file, such as when developers are: * Checking file integrity for published assets with the troubleshoot integrity PowerShell script per the guidance in . * Changing the file name extension of DLL files when not using the default Webcil file format per the guidance in . +Currently, there's no documented replacement strategy for the preceding approaches. If you require either of the preceding strategies, open a new documentation issue describing your scenario using the **Open a documentation issue** link at the bottom of either article. + ### Declarative model for persisting state from components and services You can now declaratively specify state to persist from components and services using the `[SupplyParameterFromPersistentComponentState]` attribute. Properties with this attribute are automatically persisted using the service during prerendering. The state is retrieved when the component renders interactively or the service is instantiated. From a5b9fd4305171cb5ec09fb0c90a1a3334cb07258 Mon Sep 17 00:00:00 2001 From: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com> Date: Wed, 23 Apr 2025 21:37:28 +0200 Subject: [PATCH 05/10] update links that result in 404 results (#35293) --- CONTRIBUTING.md | 2 +- aspnetcore/fundamentals/app-state.md | 4 ++-- aspnetcore/fundamentals/owin.md | 18 +++++++++--------- aspnetcore/fundamentals/servers/index.md | 2 +- .../servers/yarp/distributed-tracing.md | 2 +- .../migration/proper-to-2x/includes/index5.md | 4 ++-- aspnetcore/migration/proper-to-2x/mvc2.md | 2 +- aspnetcore/test/dev-tunnels.md | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0104fd2c72c1..c15206fa0463 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -188,7 +188,7 @@ DocFX requires: ## Voice and tone -Our goal is to write documentation that is easily understandable by the widest possible audience. To that end, we established guidelines for writing style that we ask our contributors to follow. For more information, see [Voice and tone guidelines](https://github.com/dotnet/docs/blob/main/styleguide/voice-tone.md) in the .NET repo. +Our goal is to write documentation that is easily understandable by the widest possible audience. To that end, we established guidelines for writing style that we ask our contributors to follow. For more information, see [Voice and tone guidelines](/contribute/content/dotnet/dotnet-voice-tone). ## Microsoft Writing Style Guide diff --git a/aspnetcore/fundamentals/app-state.md b/aspnetcore/fundamentals/app-state.md index ff8876142017..2bd8b3582429 100644 --- a/aspnetcore/fundamentals/app-state.md +++ b/aspnetcore/fundamentals/app-state.md @@ -230,7 +230,7 @@ To enable the session-based TempData provider, use the . +In addition to unintended sharing, including data in query strings can expose the app to [Cross-Site Request Forgery (CSRF)](https://owasp.org/www-community/attacks/csrf) attacks. Any preserved session state must protect against CSRF attacks. For more information, see . ## Hidden fields @@ -507,7 +507,7 @@ To enable the session-based TempData provider, use the . +In addition to unintended sharing, including data in query strings can expose the app to [Cross-Site Request Forgery (CSRF)](https://owasp.org/www-community/attacks/csrf) attacks. Any preserved session state must protect against CSRF attacks. For more information, see . ## Hidden fields diff --git a/aspnetcore/fundamentals/owin.md b/aspnetcore/fundamentals/owin.md index 2eaa14ba7bba..f33b6a9ff2ca 100644 --- a/aspnetcore/fundamentals/owin.md +++ b/aspnetcore/fundamentals/owin.md @@ -34,7 +34,7 @@ This allows ASP.NET Core to be hosted on top of an OWIN compatible server/host o ASP.NET Core's OWIN support is deployed as part of the `Microsoft.AspNetCore.Owin` package. You can import OWIN support into your project by installing this package. -OWIN middleware conforms to the [OWIN specification](https://owin.org/spec/spec/owin-1.0.0.html), which requires a `Func, Task>` interface, and specific keys be set (such as `owin.ResponseBody`). The following simple OWIN middleware displays "Hello World": +OWIN middleware conforms to the [OWIN specification](http://owin.org/spec/spec/owin-1.0.0.html), which requires a `Func, Task>` interface, and specific keys be set (such as `owin.ResponseBody`). The following simple OWIN middleware displays "Hello World": ```csharp public Task OwinHello(IDictionary environment) @@ -42,7 +42,7 @@ public Task OwinHello(IDictionary environment) string responseText = "Hello World via OWIN"; byte[] responseBytes = Encoding.UTF8.GetBytes(responseText); - // OWIN Environment Keys: https://owin.org/spec/spec/owin-1.0.0.html + // OWIN Environment Keys: http://owin.org/spec/spec/owin-1.0.0.html var responseStream = (Stream)environment["owin.ResponseBody"]; var responseHeaders = (IDictionary)environment["owin.ResponseHeaders"]; @@ -102,7 +102,7 @@ You can construct an OWIN environment using the `HttpContext`. ## OWIN keys -OWIN depends on an `IDictionary` object to communicate information throughout an HTTP Request/Response exchange. ASP.NET Core implements the keys listed below. See the [primary specification, extensions](https://owin.org/#spec), and [OWIN Key Guidelines and Common Keys](https://owin.org/spec/spec/CommonKeys.html). +OWIN depends on an `IDictionary` object to communicate information throughout an HTTP Request/Response exchange. ASP.NET Core implements the keys listed below. See the [primary specification, extensions](http://owin.org/#spec), and [OWIN Key Guidelines and Common Keys](http://owin.org/spec/spec/CommonKeys.html). ### Request data (OWIN v1.0.0) @@ -155,14 +155,14 @@ OWIN depends on an `IDictionary` object to communicate informatio | Key | Value (type) | Description | | ----------------- | ------------ | ----------- | -| sendfile.SendAsync | See [delegate signature](https://owin.org/spec/extensions/owin-SendFile-Extension-v0.3.0.htm) | Per Request | +| sendfile.SendAsync | See [delegate signature](http://owin.org/spec/extensions/owin-SendFile-Extension-v0.3.0.htm) | Per Request | ### Opaque v0.3.0 | Key | Value (type) | Description | | ----------------- | ------------ | ----------- | | opaque.Version | `String` | | -| opaque.Upgrade | `OpaqueUpgrade` | See [delegate signature](https://owin.org/spec/extensions/owin-SendFile-Extension-v0.3.0.htm) | +| opaque.Upgrade | `OpaqueUpgrade` | See [delegate signature](http://owin.org/spec/extensions/owin-SendFile-Extension-v0.3.0.htm) | | opaque.Stream | `Stream` | | | opaque.CallCancelled | `CancellationToken` | | @@ -171,12 +171,12 @@ OWIN depends on an `IDictionary` object to communicate informatio | Key | Value (type) | Description | | ----------------- | ------------ | ----------- | | websocket.Version | `String` | | -| websocket.Accept | `WebSocketAccept` | See [delegate signature](https://owin.org/spec/extensions/owin-SendFile-Extension-v0.3.0.htm) | +| websocket.Accept | `WebSocketAccept` | See [delegate signature](http://owin.org/spec/extensions/owin-SendFile-Extension-v0.3.0.htm) | | websocket.AcceptAlt | | Non-spec | | websocket.SubProtocol | `String` | See [RFC6455 Section 4.2.2](https://tools.ietf.org/html/rfc6455#section-4.2.2) Step 5.5 | -| websocket.SendAsync | `WebSocketSendAsync` | See [delegate signature](https://owin.org/spec/extensions/owin-SendFile-Extension-v0.3.0.htm) | -| websocket.ReceiveAsync | `WebSocketReceiveAsync` | See [delegate signature](https://owin.org/spec/extensions/owin-SendFile-Extension-v0.3.0.htm) | -| websocket.CloseAsync | `WebSocketCloseAsync` | See [delegate signature](https://owin.org/spec/extensions/owin-SendFile-Extension-v0.3.0.htm) | +| websocket.SendAsync | `WebSocketSendAsync` | See [delegate signature](http://owin.org/spec/extensions/owin-SendFile-Extension-v0.3.0.htm) | +| websocket.ReceiveAsync | `WebSocketReceiveAsync` | See [delegate signature](http://owin.org/spec/extensions/owin-SendFile-Extension-v0.3.0.htm) | +| websocket.CloseAsync | `WebSocketCloseAsync` | See [delegate signature](http://owin.org/spec/extensions/owin-SendFile-Extension-v0.3.0.htm) | | websocket.CallCancelled | `CancellationToken` | | | websocket.ClientCloseStatus | `int` | Optional | | websocket.ClientCloseDescription | `String` | Optional | diff --git a/aspnetcore/fundamentals/servers/index.md b/aspnetcore/fundamentals/servers/index.md index 7a822bab6a23..362dccf7eb76 100644 --- a/aspnetcore/fundamentals/servers/index.md +++ b/aspnetcore/fundamentals/servers/index.md @@ -43,7 +43,7 @@ Kestrel has the following advantages over HTTP.sys: * Cross platform * Agility, it's developed and patched independent of the OS. * Programmatic port and TLS configuration - * Extensibility that allows for protocols like [PPv2](https://github.com/aspnet/AspLabs/blob/main/src/ProxyProtocol/ProxyProtocol.Sample/ProxyProtocol.cs) and alternate transports. + * Extensibility that allows for protocols like [PPv2](https://www.haproxy.org/download/3.1/doc/proxy-protocol.txt) and alternate transports. Http.Sys operates as a shared kernel mode component with the following features that kestrel does not have: diff --git a/aspnetcore/fundamentals/servers/yarp/distributed-tracing.md b/aspnetcore/fundamentals/servers/yarp/distributed-tracing.md index fa8d1dbe1c82..93211051ff8e 100644 --- a/aspnetcore/fundamentals/servers/yarp/distributed-tracing.md +++ b/aspnetcore/fundamentals/servers/yarp/distributed-tracing.md @@ -28,7 +28,7 @@ These will only be created if there is a listener for the [`ActivitySource`](/do ### Example: Application Insights -For example, to monitor the traces with Application Insights, the proxy application needs to use the [Open Telemetry](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry/README) and [Azure Monitor](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/README) SDKs. +For example, to monitor the traces with Application Insights, the proxy application needs to use the [Open Telemetry](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry) and [Azure Monitor](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore) SDKs. `application.csproj`: diff --git a/aspnetcore/migration/proper-to-2x/includes/index5.md b/aspnetcore/migration/proper-to-2x/includes/index5.md index f29bf7374012..eea885504d37 100644 --- a/aspnetcore/migration/proper-to-2x/includes/index5.md +++ b/aspnetcore/migration/proper-to-2x/includes/index5.md @@ -44,7 +44,7 @@ ASP.NET Core introduced a new mechanism for bootstrapping an app. The entry poin [!code-csharp[](~/migration/proper-to-2x/samples/globalasax-sample.cs)] -This approach couples the application and the server to which it's deployed in a way that interferes with the implementation. In an effort to decouple, [OWIN](https://owin.org/) was introduced to provide a cleaner way to use multiple frameworks together. OWIN provides a pipeline to add only the modules needed. The hosting environment takes a [Startup](xref:fundamentals/startup) function to configure services and the app's request pipeline. `Startup` registers a set of middleware with the application. For each request, the application calls each of the middleware components with the head pointer of a linked list to an existing set of handlers. Each middleware component can add one or more handlers to the request handling pipeline. This is accomplished by returning a reference to the handler that's the new head of the list. Each handler is responsible for remembering and invoking the next handler in the list. With ASP.NET Core, the entry point to an application is `Startup`, and you no longer have a dependency on *Global.asax*. When using OWIN with .NET Framework, use something like the following as a pipeline: +This approach couples the application and the server to which it's deployed in a way that interferes with the implementation. In an effort to decouple, [OWIN](http://owin.org/) was introduced to provide a cleaner way to use multiple frameworks together. OWIN provides a pipeline to add only the modules needed. The hosting environment takes a [Startup](xref:fundamentals/startup) function to configure services and the app's request pipeline. `Startup` registers a set of middleware with the application. For each request, the application calls each of the middleware components with the head pointer of a linked list to an existing set of handlers. Each middleware component can add one or more handlers to the request handling pipeline. This is accomplished by returning a reference to the handler that's the new head of the list. Each handler is responsible for remembering and invoking the next handler in the list. With ASP.NET Core, the entry point to an application is `Startup`, and you no longer have a dependency on *Global.asax*. When using OWIN with .NET Framework, use something like the following as a pipeline: [!code-csharp[](~/migration/proper-to-2x/samples/webapi-owin.cs)] @@ -197,4 +197,4 @@ For apps that post JSON information to controllers and use JSON Input Formatters * [Porting Libraries to .NET Core](/dotnet/core/porting/libraries) -:::moniker-end \ No newline at end of file +:::moniker-end diff --git a/aspnetcore/migration/proper-to-2x/mvc2.md b/aspnetcore/migration/proper-to-2x/mvc2.md index 2488e4a07474..68b659b665cc 100644 --- a/aspnetcore/migration/proper-to-2x/mvc2.md +++ b/aspnetcore/migration/proper-to-2x/mvc2.md @@ -54,7 +54,7 @@ ASP.NET Core introduced a new mechanism for bootstrapping an app. The entry poin [!code-csharp[](samples/globalasax-sample.cs)] -This approach couples the application and the server to which it's deployed in a way that interferes with the implementation. In an effort to decouple, [OWIN](https://owin.org/) was introduced to provide a cleaner way to use multiple frameworks together. OWIN provides a pipeline to add only the modules needed. The hosting environment takes a [Startup](xref:fundamentals/startup) function to configure services and the app's request pipeline. `Startup` registers a set of middleware with the application. For each request, the application calls each of the middleware components with the head pointer of a linked list to an existing set of handlers. Each middleware component can add one or more handlers to the request handling pipeline. This is accomplished by returning a reference to the handler that's the new head of the list. Each handler is responsible for remembering and invoking the next handler in the list. With ASP.NET Core, the entry point to an application is `Startup`, and you no longer have a dependency on *Global.asax*. When using OWIN with .NET Framework, use something like the following as a pipeline: +This approach couples the application and the server to which it's deployed in a way that interferes with the implementation. In an effort to decouple, [OWIN](http://owin.org/) was introduced to provide a cleaner way to use multiple frameworks together. OWIN provides a pipeline to add only the modules needed. The hosting environment takes a [Startup](xref:fundamentals/startup) function to configure services and the app's request pipeline. `Startup` registers a set of middleware with the application. For each request, the application calls each of the middleware components with the head pointer of a linked list to an existing set of handlers. Each middleware component can add one or more handlers to the request handling pipeline. This is accomplished by returning a reference to the handler that's the new head of the list. Each handler is responsible for remembering and invoking the next handler in the list. With ASP.NET Core, the entry point to an application is `Startup`, and you no longer have a dependency on *Global.asax*. When using OWIN with .NET Framework, use something like the following as a pipeline: [!code-csharp[](samples/webapi-owin.cs)] diff --git a/aspnetcore/test/dev-tunnels.md b/aspnetcore/test/dev-tunnels.md index 622c2522f7ac..3365b8521cc3 100644 --- a/aspnetcore/test/dev-tunnels.md +++ b/aspnetcore/test/dev-tunnels.md @@ -16,7 +16,7 @@ The *dev tunnels* feature of Visual Studio 2022 enables ad-hoc connections betwe Some of the scenarios that dev tunnels enable: * Test a web app on other devices, like mobile phones and tablets. -* Test an app with external services. For instance, test and debug [Power Platform connectors](/connectors/custom-connectors/port-tunneling), [Azure Communication Services APIs](https://github.com/Azure-Samples/communication-services-dotnet-quickstarts/tree/main/CallAutomation_AppointmentReminder/CallAutomation_AppointmentReminder), or [Twilio webhooks](https://www.twilio.com/blog/use-visual-studio-port-tunneling-with-twilio-webhooks). +* Test an app with external services. For instance, test and debug [Power Platform connectors](/connectors/custom-connectors/port-tunneling), [Azure Communication Services APIs](https://github.com/Azure-Samples/communication-services-dotnet-quickstarts), or [Twilio webhooks](https://www.twilio.com/blog/use-visual-studio-port-tunneling-with-twilio-webhooks). * Make an app temporarily available to others over the internet, for a presentation or to invite others to review your work on a web app or API. * As an alternative to other port-forwarding solutions. From cea646de6d7d7c262f3eacca6be44956a71d632f Mon Sep 17 00:00:00 2001 From: Robert Haken Date: Wed, 23 Apr 2025 14:13:02 -0700 Subject: [PATCH 06/10] [Blazor] AuthorizeView - Roles+Policy together (#35297) --- aspnetcore/blazor/security/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aspnetcore/blazor/security/index.md b/aspnetcore/blazor/security/index.md index a602c94a261f..ff89ffc55471 100644 --- a/aspnetcore/blazor/security/index.md +++ b/aspnetcore/blazor/security/index.md @@ -1230,6 +1230,8 @@ To handle the case where the user must satisfy several policies simultaneously, Claims-based authorization is a special case of policy-based authorization. For example, you can define a policy that requires users to have a certain claim. For more information, see . +If both and are set, authorization succeeds only when both conditions are satisfied. That is, the user must belong to at least one of the specified roles *and* meet the requirements defined by the policy. + If neither nor is specified, uses the default policy: * Authenticated (signed-in) users are authorized. From 0731548b9cb7fcc085db966b7fe91b9a717216bc Mon Sep 17 00:00:00 2001 From: Wade Pickett Date: Wed, 23 Apr 2025 14:22:54 -0700 Subject: [PATCH 07/10] Run Docker: Update .NET 10 (#35285) --- .../docker/building-net-docker-images.md | 2 +- .../includes/building-net-docker-images10.md | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/aspnetcore/host-and-deploy/docker/building-net-docker-images.md b/aspnetcore/host-and-deploy/docker/building-net-docker-images.md index 371860f133bd..282bb63bd3a5 100644 --- a/aspnetcore/host-and-deploy/docker/building-net-docker-images.md +++ b/aspnetcore/host-and-deploy/docker/building-net-docker-images.md @@ -4,7 +4,7 @@ author: rick-anderson description: Learn how to use the published ASP.NET Core Docker images from the Docker Registry. Pull and build your own images. ms.author: wpickett ms.custom: mvc, linux-related-content -ms.date: 5/15/2024 +ms.date: 04/22/2025 uid: host-and-deploy/docker/building-net-docker-images --- diff --git a/aspnetcore/host-and-deploy/docker/includes/building-net-docker-images10.md b/aspnetcore/host-and-deploy/docker/includes/building-net-docker-images10.md index b3e58f8b0d56..15c67610745f 100644 --- a/aspnetcore/host-and-deploy/docker/includes/building-net-docker-images10.md +++ b/aspnetcore/host-and-deploy/docker/includes/building-net-docker-images10.md @@ -16,7 +16,7 @@ The sample Dockerfile uses the [Docker multi-stage build feature](https://docs.d ## Prerequisites -* [.NET SDK 9.0](https://dotnet.microsoft.com/download) +* [.NET SDK 10.0](https://dotnet.microsoft.com/download) * Docker client 18.03 or later * Linux distributions @@ -25,7 +25,7 @@ The sample Dockerfile uses the [Docker multi-stage build feature](https://docs.d * [Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/) * [macOS](https://docs.docker.com/desktop/mac/install/) * [Windows](https://docs.docker.com/desktop/windows/install/) - + * [Git](https://git-scm.com/download) ## Download the sample app @@ -112,7 +112,7 @@ In some scenarios, you might want to deploy an app to a container by copying its To use the manually published app within a Docker container, create a new *Dockerfile* and use the `docker build .` command to build an image. ```dockerfile -FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime +FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime WORKDIR /app COPY published/ ./ ENTRYPOINT ["dotnet", "aspnetapp.dll"] @@ -122,11 +122,11 @@ To see the new image use the `docker images` command. ### The Dockerfile -Here's the *Dockerfile* used by the `docker build` command you ran earlier. It uses `dotnet publish` the same way you did in this section to build and deploy. +Here's the *Dockerfile* used by the `docker build` command you ran earlier. It uses `dotnet publish` the same way you did in this section to build and deploy. ```dockerfile # https://hub.docker.com/_/microsoft-dotnet -FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build WORKDIR /source # copy csproj and restore as distinct layers @@ -140,13 +140,13 @@ WORKDIR /source/aspnetapp RUN dotnet publish -c release -o /app --no-restore # final stage/image -FROM mcr.microsoft.com/dotnet/aspnet:9.0 +FROM mcr.microsoft.com/dotnet/aspnet:10.0 WORKDIR /app COPY --from=build /app ./ ENTRYPOINT ["dotnet", "aspnetapp.dll"] ``` -In the preceding *Dockerfile*, the `*.csproj` files are copied and restored as distinct *layers*. When the `docker build` command builds an image, it uses a built-in cache. If the `*.csproj` files haven't changed since the `docker build` command last ran, the `dotnet restore` command doesn't need to run again. Instead, the built-in cache for the corresponding `dotnet restore` layer is reused. For more information, see [Best practices for writing Dockerfiles](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache). +In the preceding *Dockerfile*, the `*.csproj` files are copied and restored as distinct *layers*. When the `docker build` command builds an image, it uses a built-in cache. If the `*.csproj` files did not change since the `docker build` command last ran, the `dotnet restore` command doesn't need to run again. Instead, the built-in cache for the corresponding `dotnet restore` layer is reused. For more information, see [Best practices for writing Dockerfiles](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache). ## Additional resources From f9d5d67506edb6d9d20de5bbc079762b97719ba3 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Wed, 23 Apr 2025 17:28:35 -0400 Subject: [PATCH 08/10] Remove broken sample link (#35296) --- .../host-and-deploy/webassembly/deployment-layout.md | 2 -- aspnetcore/data/scaffold_RP.md | 9 ++++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/aspnetcore/blazor/host-and-deploy/webassembly/deployment-layout.md b/aspnetcore/blazor/host-and-deploy/webassembly/deployment-layout.md index e56a98f3c79c..7c028366e0a0 100644 --- a/aspnetcore/blazor/host-and-deploy/webassembly/deployment-layout.md +++ b/aspnetcore/blazor/host-and-deploy/webassembly/deployment-layout.md @@ -46,8 +46,6 @@ The approach demonstrated in this article serves as a starting point for develop The approach described in this article is used by the *experimental* [`Microsoft.AspNetCore.Components.WebAssembly.MultipartBundle` package (NuGet.org)](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebAssembly.MultipartBundle) for apps targeting .NET 6 or later. The package contains MSBuild targets to customize the Blazor publish output and a [JavaScript initializer](xref:blazor/js-interop/index#javascript-initializers) to use a custom [boot resource loader](xref:blazor/fundamentals/startup#load-boot-resources), each of which are described in detail later in this article. -[Experimental code (includes the NuGet package reference source and `CustomPackagedApp` sample app)](https://github.com/aspnet/AspLabs/tree/main/src/BlazorWebAssemblyCustomInitialization) - > [!WARNING] > Experimental and preview features are provided for the purpose of collecting feedback and aren't supported for production use. diff --git a/aspnetcore/data/scaffold_RP.md b/aspnetcore/data/scaffold_RP.md index 4db83f24d910..f8166b2c2ad8 100644 --- a/aspnetcore/data/scaffold_RP.md +++ b/aspnetcore/data/scaffold_RP.md @@ -10,7 +10,6 @@ content_well_notification: AI-contribution ai-usage: ai-assisted uid: data/dotnet-scaffold-rp --- - # Scaffold a data model with dotnet scaffold in a Razor Pages project The CLI tool, [dotnet scaffold](https://www.nuget.org/packages/Microsoft.dotnet-scaffold) creates data access UI for many .NET project types, such as API, Aspire, Blazor, MVC, and Razor Pages. `dotnet scaffold` can be run interactively or as a command line tool via passing parameter values. @@ -39,7 +38,7 @@ To navigate the UI, use the: ## Create and scaffold a data model in a Razor Pages project -If you have any problems with the following steps, see [Tutorial: Create a Razor Pages web app with ASP.NET Core](/aspnet/core/tutorials/razor-pages/) and select the **Visual Studio Code** tab. +If you have any problems with the following steps, see . 1. Run the following commands to create a Razor Pages project and navigate to the projects folder: ```dotnetcli @@ -78,7 +77,7 @@ In The preceding commands: * `dotnet tool uninstall --global dotnet-ef` uninstalls the `dotnet-ef` tool. Uninstalling ensures the latest tool is successfully installed. If `dotnet-ef` isn't installed, an error messages **A tool with the package Id 'dotnet-ef' could not be found.** You can ignore this message. * `dotnet tool install --global dotnet-ef` installs globally the `dotnet-ef` tool. -* `dotnet ef migrations add initialMigration` adds the initial migration. For more information, see [Create the initial database schema using EF's migration feature](/aspnet/core/tutorials/razor-pages/model&tabs=visual-studio-code) +* `dotnet ef migrations add initialMigration` adds the initial migration. For more information, see . * `dotnet ef database update` applies the migrations to the database. Run the app: @@ -94,5 +93,5 @@ Run the app: * [dotnet scaffold repo on GitHub](https://github.com/dotnet/Scaffolding) * [How to manage .NET tools](/dotnet/core/tools/global-tools) -* [Microsoft.dotnet-scaffold](https://www.nuget.org/packages/Microsoft.dotnet-scaffold) NuGet package. -* [Detailed tutorial on EF scaffolding Razor Pages](/aspnet/core/data/scaffold_rp) +* [`Microsoft.dotnet-scaffold`](https://www.nuget.org/packages/Microsoft.dotnet-scaffold) NuGet package. +* From 363486aa85b46ef4b776bc3ef3d6c3c4b93d1e47 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Wed, 23 Apr 2025 17:32:56 -0400 Subject: [PATCH 09/10] Remove lead-in pattern-based examples (#35298) --- aspnetcore/blazor/components/prerender.md | 107 +--------------------- 1 file changed, 3 insertions(+), 104 deletions(-) diff --git a/aspnetcore/blazor/components/prerender.md b/aspnetcore/blazor/components/prerender.md index 211b904e15f2..055bad335d8c 100644 --- a/aspnetcore/blazor/components/prerender.md +++ b/aspnetcore/blazor/components/prerender.md @@ -53,21 +53,10 @@ To preserve prerendered state, use the `[SupplyParameterFromPersistentComponentS By default, properties are serialized using the serializer with default settings. Serialization isn't trimmer safe and requires preservation of the types used. For more information, see . -The following example demonstrates the general pattern, where the `{TYPE}` placeholder represents the type of data to persist. +The following counter component persists counter state during prerendering and retrieves the state to initialize the component: -```razor -@code { - [SupplyParameterFromPersistentComponentState] - public {TYPE} Data { get; set; } - - protected override async Task OnInitializedAsync() - { - Data ??= await ...; - } -} -``` - -The following counter component example persists counter state during prerendering and retrieves the state to initialize the component. +* The `[SupplyParameterFromPersistentComponentState]` attribute is applied to the `CounterState` type (`State`). +* The counter's state is assigned when `null` in `OnInitialized` and restored automatically when the component renders interactively. `PrerenderedCounter2.razor`: @@ -252,51 +241,6 @@ Serialized properties are identified from the actual service instance: As an alternative to using the declarative model for persisting state with the `[SupplyParameterFromPersistentComponentState]` attribute, you can use the service directly, which offers greater flexibility for complex state persistence scenarios. Call to register a callback to persist the component state during prerendering. The state is retrieved when the component renders interactively. Make the call at the end of initialization code in order to avoid a potential race condition during app shutdown. -The following example demonstrates the general pattern: - -* The `{TYPE}` placeholder represents the type of data to persist. -* The `{TOKEN}` placeholder is a state identifier string. Consider using `nameof({VARIABLE})`, where the `{VARIABLE}` placeholder is the name of the variable that holds the state. Using [`nameof()`](/dotnet/csharp/language-reference/operators/nameof) for the state identifier avoids the use of a quoted string. - -```razor -@implements IDisposable -@inject PersistentComponentState ApplicationState - -... - -@code { - private {TYPE} data; - private PersistingComponentStateSubscription persistingSubscription; - - protected override async Task OnInitializedAsync() - { - if (!ApplicationState.TryTakeFromJson<{TYPE}>( - "{TOKEN}", out var restored)) - { - data = await ...; - } - else - { - data = restored!; - } - - // Call at the end to avoid a potential race condition at app shutdown - persistingSubscription = ApplicationState.RegisterOnPersisting(PersistData); - } - - private Task PersistData() - { - ApplicationState.PersistAsJson("{TOKEN}", data); - - return Task.CompletedTask; - } - - void IDisposable.Dispose() - { - persistingSubscription.Dispose(); - } -} -``` - The following counter component example persists counter state during prerendering and retrieves the state to initialize the component. `PrerenderedCounter3.razor`: @@ -366,51 +310,6 @@ When the component executes, `currentCount` is only set once during prerendering To preserve prerendered state, decide what state to persist using the service. registers a callback to persist the component state during prerendering. The state is retrieved when the component renders interactively. Make the call at the end of initialization code in order to avoid a potential race condition during app shutdown. -The following example demonstrates the general pattern: - -* The `{TYPE}` placeholder represents the type of data to persist. -* The `{TOKEN}` placeholder is a state identifier string. Consider using `nameof({VARIABLE})`, where the `{VARIABLE}` placeholder is the name of the variable that holds the state. Using [`nameof()`](/dotnet/csharp/language-reference/operators/nameof) for the state identifier avoids the use of a quoted string. - -```razor -@implements IDisposable -@inject PersistentComponentState ApplicationState - -... - -@code { - private {TYPE} data; - private PersistingComponentStateSubscription persistingSubscription; - - protected override async Task OnInitializedAsync() - { - if (!ApplicationState.TryTakeFromJson<{TYPE}>( - "{TOKEN}", out var restored)) - { - data = await ...; - } - else - { - data = restored!; - } - - // Call at the end to avoid a potential race condition at app shutdown - persistingSubscription = ApplicationState.RegisterOnPersisting(PersistData); - } - - private Task PersistData() - { - ApplicationState.PersistAsJson("{TOKEN}", data); - - return Task.CompletedTask; - } - - void IDisposable.Dispose() - { - persistingSubscription.Dispose(); - } -} -``` - The following counter component example persists counter state during prerendering and retrieves the state to initialize the component. `PrerenderedCounter2.razor`: From a880b5c72a08ce93387fb5378b3e1a79350cbac5 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Wed, 23 Apr 2025 17:46:21 -0400 Subject: [PATCH 10/10] Change OSI links (#35299) --- .../metrics/built-in/includes/built-in10.md | 36 +++++++++---------- .../metrics/built-in/includes/built-in8.md | 36 +++++++++---------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index 872cec5c7663..5edff312c615 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -222,8 +222,8 @@ The `Microsoft.AspNetCore.Server.Kestrel` metrics report HTTP connection informa | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type`| string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `network.transport` | string | [OSI transport layer](https://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type`| string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port`| int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | @@ -238,10 +238,10 @@ The `Microsoft.AspNetCore.Server.Kestrel` metrics report HTTP connection informa | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| | `error.type` | string | Describes a type of error the connection ended with, or the unhandled exception type thrown during the connection pipeline. Known connection errors can be found at [Semantic Conventions for Kestrel web server metrics](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/). | `connection_reset`; `invalid_request_headers`; `System.OperationCanceledException` | If the connection ended with a known error or an exception was thrown. | -| `network.protocol.name` | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. | `http`; `web_sockets` | Always | +| `network.protocol.name` | string | [OSI application layer](https://www.geeksforgeeks.org/application-layer-in-osi-model/) or non-OSI equivalent. | `http`; `web_sockets` | Always | | `network.protocol.version` | string | Version of the protocol specified in `network.protocol.name`. | `1.1`; `2` | Always | -| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `network.transport` | string | [OSI transport layer](https://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | | `tls.protocol.version` | string | TLS protocol version. | `1.2`; `1.3` | If the connection is secured with TLS. | @@ -258,8 +258,8 @@ When a connection ends with a known error, the `error.type` attribute value is s | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `network.transport`| string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `network.transport`| string | [OSI transport layer](https://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | | `server.address`| string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | @@ -275,8 +275,8 @@ Connections are rejected when the currently active count exceeds the value confi | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `network.transport` | string | [OSI transport layer](https://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | @@ -290,10 +290,10 @@ Connections are rejected when the currently active count exceeds the value confi | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `network.protocol.name` | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. | `http`; `web_sockets` | Always | +| `network.protocol.name` | string | [OSI application layer](https://www.geeksforgeeks.org/application-layer-in-osi-model/) or non-OSI equivalent. | `http`; `web_sockets` | Always | | `network.protocol.version` | string | Version of the protocol specified in `network.protocol.name`. | `1.1`; `2` | Always | -| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `network.transport` | string | [OSI transport layer](https://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | @@ -307,8 +307,8 @@ Connections are rejected when the currently active count exceeds the value confi | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `network.transport` | string | [OSI transport layer](https://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | @@ -325,8 +325,8 @@ The counter only tracks HTTP/1.1 connections. | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| | `error.type` | string | The full name of exception type. | `System.OperationCanceledException`; `Contoso.MyException` | If an exception was thrown. | -| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `network.transport` | string | [OSI transport layer](https://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | | `tls.protocol.version` | string | TLS protocol version. | `1.2`; `1.3` | If the connection is secured with TLS. | @@ -343,8 +343,8 @@ When using OpenTelemetry, the default buckets for this metic are set to [ 0.005, | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `network.transport` | string | [OSI transport layer](https://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md index e9450b1f510c..d873975caba0 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md @@ -203,8 +203,8 @@ The `Microsoft.AspNetCore.Server.Kestrel` metrics report HTTP connection informa | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type`| string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `network.transport` | string | [OSI transport layer](https://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type`| string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port`| int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | @@ -217,10 +217,10 @@ The `Microsoft.AspNetCore.Server.Kestrel` metrics report HTTP connection informa | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| | `error.type` | string | Describes a type of error the connection ended with, or the unhandled exception type thrown during the connection pipeline. Known connection errors can be found at [Semantic Conventions for Kestrel web server metrics](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/). | `connection_reset`; `invalid_request_headers`; `System.OperationCanceledException` | If the connection ended with a known error or an exception was thrown. | -| `network.protocol.name` | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. | `http`; `web_sockets` | Always | +| `network.protocol.name` | string | [OSI application layer](https://www.geeksforgeeks.org/application-layer-in-osi-model/) or non-OSI equivalent. | `http`; `web_sockets` | Always | | `network.protocol.version` | string | Version of the protocol specified in `network.protocol.name`. | `1.1`; `2` | Always | -| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `network.transport` | string | [OSI transport layer](https://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | | `tls.protocol.version` | string | TLS protocol version. | `1.2`; `1.3` | If the connection is secured with TLS. | @@ -245,8 +245,8 @@ When a connection ends with a known error, the `error.type` attribute value is s | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `network.transport`| string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `network.transport`| string | [OSI transport layer](https://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | | `server.address`| string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | @@ -260,8 +260,8 @@ Connections are rejected when the currently active count exceeds the value confi | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `network.transport` | string | [OSI transport layer](https://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | @@ -273,10 +273,10 @@ Connections are rejected when the currently active count exceeds the value confi | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `network.protocol.name` | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. | `http`; `web_sockets` | Always | +| `network.protocol.name` | string | [OSI application layer](https://www.geeksforgeeks.org/application-layer-in-osi-model/) or non-OSI equivalent. | `http`; `web_sockets` | Always | | `network.protocol.version` | string | Version of the protocol specified in `network.protocol.name`. | `1.1`; `2` | Always | -| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `network.transport` | string | [OSI transport layer](https://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | @@ -288,8 +288,8 @@ Connections are rejected when the currently active count exceeds the value confi | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `network.transport` | string | [OSI transport layer](https://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | @@ -304,8 +304,8 @@ The counter only tracks HTTP/1.1 connections. | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| | `error.type` | string | The full name of exception type. | `System.OperationCanceledException`; `Contoso.MyException` | If an exception was thrown. | -| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `network.transport` | string | [OSI transport layer](https://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | | `tls.protocol.version` | string | TLS protocol version. | `1.2`; `1.3` | If the connection is secured with TLS. | @@ -320,8 +320,8 @@ When using OpenTelemetry, the default buckets for this metic are set to [ 0.005, | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `network.transport` | string | [OSI transport layer](https://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. |