diff --git a/aspnetcore/blazor/fundamentals/index.md b/aspnetcore/blazor/fundamentals/index.md
index 8195bbc43c45..c7faf7125c6c 100644
--- a/aspnetcore/blazor/fundamentals/index.md
+++ b/aspnetcore/blazor/fundamentals/index.md
@@ -1,10 +1,11 @@
---
title: ASP.NET Core Blazor fundamentals
+ai-usage: ai-assisted
author: guardrex
description: Learn foundational concepts of the Blazor application framework.
monikerRange: '>= aspnetcore-3.1'
ms.author: wpickett
-ms.date: 11/11/2025
+ms.date: 09/03/2026
uid: blazor/fundamentals/index
---
# ASP.NET Core Blazor fundamentals
@@ -150,15 +151,6 @@ The preceding information on render modes is all that you need to know to unders
:::moniker-end
-## Document Object Model (DOM)
-
-References to the *Document Object Model* use the abbreviation *DOM*.
-
-For more information, see the following resources:
-
-* [Introduction to the DOM (MDN documentation)](https://developer.mozilla.org/docs/Web/API/Document_Object_Model/Introduction)
-* [Level 1 Document Object Model Specification (W3C)](https://www.w3.org/TR/WD-DOM/)
-
## Subset of .NET APIs for Blazor WebAssembly apps
A curated list of specific .NET APIs that are supported on the browser for Blazor WebAssembly isn't available. However, you can manually [search for a list of .NET APIs annotated with `[UnsupportedOSPlatform("browser")]`](https://source.dot.net/#System.Private.CoreLib/src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/PlatformAttributes.cs,34041602e232c616,references) to discover .NET APIs that aren't supported in WebAssembly.
@@ -234,37 +226,6 @@ The ASP.NET Core repository's Basic Test App is also a helpful set of samples fo
[!INCLUDE[](~/includes/aspnetcore-repo-ref-source-links.md)]
-## Byte multiples
-
-.NET byte sizes use metric prefixes for non-decimal multiples of bytes based on powers of 1024.
-
-| Name (abbreviation) | Size | Example |
-| ------------------- | ----------------------- | -------------------------- |
-| Kilobyte (KB) | 1,024 bytes | 1 KB = 1,024 bytes |
-| Megabyte (MB) | 1,0242 bytes | 1 MB = 1,048,576 bytes |
-| Gigabyte (GB) | 1,0243 bytes | 1 GB = 1,073,741,824 bytes |
-
-## Support requests
-
-Only documentation-related issues are appropriate for the `dotnet/AspNetCore.Docs` repository. ***For product support, don't open a documentation issue.*** Seek assistance through one or more of the following support channels:
-
-* [Stack Overflow (tagged: `blazor`)](https://stackoverflow.com/questions/tagged/blazor)
-* [General ASP.NET Core Slack Team](https://join.slack.com/t/aspnetcore/shared_invite/zt-1mv5487zb-EOZxJ1iqb0A0ajowEbxByQ)
-* [Blazor Gitter](https://gitter.im/aspnet/Blazor)
-
-For a potential bug in the framework or product feedback, open an issue for the ASP.NET Core product unit at [`dotnet/aspnetcore` issues](https://github.com/dotnet/aspnetcore/issues). Bug reports usually ***require*** the following:
-
-* **Clear explanation of the problem**: Follow the instructions in the GitHub issue template provided by the product unit when opening the issue.
-* **Minimal repro project**: Place a project on GitHub for the product unit engineers to download and run. Cross-link the project into the issue's opening comment.
-
-For a potential problem with a Blazor article, open a documentation issue. To open a documentation issue, use the **Open a documentation issue** feedback link at the bottom of the article. Metadata added to your issue provides tracking data and automatically pings the author of the article. If the subject was discussed with the product unit prior to opening the documentation issue, place a cross-link to the engineering issue in the documentation issue's opening comment.
-
-For problems or feedback on Visual Studio, use the [**Report a Problem**](/visualstudio/ide/how-to-report-a-problem-with-visual-studio) or [**Suggest a Feature**](/visualstudio/ide/suggest-a-feature) gestures from within Visual Studio, which open internal issues for Visual Studio. For more information, see [Visual Studio Feedback](https://developercommunity.visualstudio.com/home).
-
-For problems with Visual Studio Code, ask for support on community support forums. For bug reports and product feedback, open an issue on the [`microsoft/vscode` GitHub repo](https://github.com/microsoft/vscode/issues).
-
-GitHub issues for Blazor documentation are automatically marked for triage on the [`Blazor.Docs` project (`dotnet/AspNetCore.Docs` GitHub repository)](https://github.com/dotnet/AspNetCore.Docs/projects/35). Please wait a short while for a response, especially over weekends and holidays. Usually, documentation authors respond within 24 hours on weekdays.
-
## Community links to Blazor resources
For a collection of links to Blazor resources maintained by the community, visit [Awesome Blazor](https://github.com/AdrienTorris/awesome-blazor).
diff --git a/aspnetcore/fundamentals/index.md b/aspnetcore/fundamentals/index.md
index 69a807454176..865a97a21abf 100644
--- a/aspnetcore/fundamentals/index.md
+++ b/aspnetcore/fundamentals/index.md
@@ -1,78 +1,316 @@
---
title: ASP.NET Core fundamentals overview
+ai-usage: ai-assisted
author: tdykstra
description: Learn the fundamental concepts for building ASP.NET Core apps, including dependency injection (DI), configuration, middleware, and more.
monikerRange: '>= aspnetcore-3.1'
ms.author: tdykstra
-ms.date: 07/23/2025
+ms.date: 09/03/2026
uid: fundamentals/index
---
# ASP.NET Core fundamentals overview
[!INCLUDE[](~/includes/not-latest-version.md)]
-:::moniker range=">= aspnetcore-9.0"
-
-This article provides an overview of the fundamentals for building ASP.NET Core apps, including dependency injection (DI), configuration, middleware, and more.
+This article provides an overview of the fundamentals for building ASP.NET Core apps, including dependency injection (DI), configuration, and middleware.
For Blazor fundamentals guidance, which adds to or supersedes the guidance in this article, see .
-## Program.cs
+:::moniker range=">= aspnetcore-6.0"
+
+## The `Program` file
-ASP.NET Core apps created with the web templates contain the application startup code in the `Program.cs` file. The `Program.cs` file is where:
+ASP.NET Core apps created from the framework's project templates contain startup code in the `Program` file (`Program.cs`). The `Program` file is where:
* Services required by the app are configured.
* The app's request handling pipeline is defined as a series of [middleware components](xref:fundamentals/middleware/index).
+:::moniker-end
+
+:::moniker range=">= aspnetcore-11.0"
+
+The following app startup code supports two app types:
+
+* [Blazor Web Apps](xref:blazor/index)
+* [Minimal APIs](xref:tutorials/min-web-api)
+
+[!code-csharp[](~/fundamentals/index/snapshot/Program11.cs)]
+
+> [!NOTE]
+> With additional configuration in the `Program` file, ASP.NET Core apps can support [Razor Pages](xref:tutorials/razor-pages/razor-pages-start), [MVC](xref:tutorials/first-mvc-app/start-mvc), and [web API with controllers](xref:tutorials/first-web-api).
+
+:::moniker-end
+
+:::moniker range=">= aspnetcore-10.0 < aspnetcore-11.0"
+
+The following app startup code supports two app types:
+
+* [Blazor Web Apps](xref:blazor/index)
+* [Minimal APIs](xref:tutorials/min-web-api)
+
+[!code-csharp[](~/fundamentals/index/snapshot/Program10.cs)]
+
+> [!NOTE]
+> With additional configuration in the `Program` file, ASP.NET Core apps can support [Razor Pages](xref:tutorials/razor-pages/razor-pages-start), [MVC](xref:tutorials/first-mvc-app/start-mvc), and [web API with controllers](xref:tutorials/first-web-api).
+
+:::moniker-end
+
+:::moniker range=">= aspnetcore-8.0 < aspnetcore-10.0"
+
The following app startup code supports several app types:
* [Blazor Web Apps](xref:blazor/index)
-* [Razor Pages](xref:tutorials/razor-pages/razor-pages-start)
+* [Razor Pages](xref:tutorials/razor-pages/index)
* [MVC controllers with views](xref:tutorials/first-mvc-app/start-mvc)
+* [Minimal APIs](xref:tutorials/min-web-api)
* [Web API with controllers](xref:tutorials/first-web-api)
-* [Minimal web APIs](xref:tutorials/min-web-api)
-[!code-csharp[](~/fundamentals/startup/9.0_samples/WebAll/Program.cs?name=snippet)]
+[!code-csharp[](~/fundamentals/index/snapshot/Program8.cs)]
+
+:::moniker-end
+
+:::moniker range=">= aspnetcore-6.0 < aspnetcore-8.0"
+
+The following app startup code supports:
+
+* [Razor Pages](xref:tutorials/razor-pages/index)
+* [MVC controllers with views](xref:tutorials/first-mvc-app/start-mvc)
+* [Minimal APIs](xref:tutorials/min-web-api)
+* [Web API with controllers](xref:tutorials/first-web-api)
+
+[!code-csharp[](~/fundamentals/index/snapshot/Program6.cs)]
+
+:::moniker-end
+
+:::moniker range="< aspnetcore-6.0"
+
+## The `Startup` class
+
+The `Startup` class (`Startup.cs`) is where:
+
+* Services required by the app are configured in the `ConfigureServices` method.
+* The app's request handling pipeline is defined in the `Configure` method as a series of [middleware components](xref:fundamentals/middleware/index).
+
+The following app startup code supports:
+
+* [Razor Pages](xref:tutorials/razor-pages/index)
+* [MVC controllers with views](xref:tutorials/first-mvc-app/start-mvc)
+* [Web API with controllers](xref:tutorials/first-web-api)
+
+[!code-csharp[](~/fundamentals/index/snapshot/Startup3.cs?highlight=3,12)]
+
+:::moniker-end
+
+For more information, see the following resources:
+
+*
+*
## Dependency injection (services)
-ASP.NET Core features built-in [dependency injection (DI)](xref:fundamentals/dependency-injection) that makes configured services available throughout an app. Services are added to the DI container with [WebApplicationBuilder.Services](xref:Microsoft.AspNetCore.Builder.WebApplicationBuilder.Services), `builder.Services` in the preceding code. When the is instantiated, many [framework-provided services](xref:fundamentals/dependency-injection#framework-provided-services) are added automatically. `builder` is a `WebApplicationBuilder` in the following code:
+ASP.NET Core features built-in [dependency injection (DI)](xref:fundamentals/dependency-injection) that makes configured services available throughout an app for [Inversion of Control (IoC)](/dotnet/standard/modern-web-apps-azure-architecture/architectural-principles#dependency-inversion).
+
+:::moniker range=">= aspnetcore-6.0"
+
+When the is instantiated by , [framework-provided services](xref:fundamentals/dependency-injection#framework-provided-services) are automatically added, such as services for configuration and logging:
+
+```csharp
+var builder = WebApplication.CreateBuilder(args);
+```
+
+Additional services are added to the DI container with . The following example registers [Blazor](xref:blazor/index) services:
+
+:::moniker-end
+
+:::moniker range=">= aspnetcore-8.0"
+
+```csharp
+builder.Services.AddRazorComponents()
+ .AddInteractiveServerComponents();
+```
+
+:::moniker-end
+
+:::moniker range=">= aspnetcore-6.0 < aspnetcore-8.0"
+
+```csharp
+builder.Services.AddServerSideBlazor();
+```
+
+:::moniker-end
-:::code language="csharp" source="~/fundamentals/startup/6.0_samples/WebAll/Program.cs" id="snippet2":::
+:::moniker range=">= aspnetcore-6.0"
-In the preceding code, `CreateBuilder` adds configuration, logging, and [many other services](xref:fundamentals/dependency-injection#framework-provided-services) to the DI container. The DI framework provides an instance of a requested service at run time.
+The DI framework provides instances of requested services at run time. In Blazor apps, services are often resolved from DI at run time using the [`@inject`](xref:mvc/views/razor#inject) directive in a [Razor component](xref:blazor/components/index) file (`.razor`). Blazor apps use the built-in service for querying and managing URI navigation. The service can be injected into a Razor component and used as a property of the component's class. In the following example, the component is using the abstraction to get an instance of the navigation manager to navigate the user to a page of products at `/products` when the button is selected:
-The following code adds a custom and Blazor components to the DI container:
+```razor
+@inject NavigationManager Navigation
-:::code language="csharp" source="~/fundamentals/index/samples/9.0/BlazorWebAppMovies/Program.cs" id="snippet_services" highlight="2-4,11-12":::
+
+
+@code {
+ private void NavigateToProductList()
+ {
+ Navigation.NavigateTo("/products");
+ }
+}
+```
+
+Another way to resolve a service from DI is using constructor injection. In the following example, the [primary constructor (C# 12 or later)](/dotnet/csharp/whats-new/tutorials/primary-constructors) takes parameters of the types `AppDbContext` and `ILogger` and resolves them at run time into the `context` and `logger` variables (the instances of the database and logging abstractions). The database context instance is used to process all of the orders where the `IsProcessed` field is `false` in the database, and each processed order is logged as information with its order ID (`OrderId`) using the logger instance:
+
+```csharp
+public class OrderProcessor(AppDbContext context, ILogger logger)
+{
+ public async Task ProcessPendingOrdersAsync()
+ {
+ var orders = await context.Orders
+ .Where(o => !o.IsProcessed)
+ .ToListAsync();
+
+ foreach (var order in orders)
+ {
+ order.IsProcessed = true;
+ logger.LogInformation("Processed order ID {OrderId}.", order.Id);
+ }
+
+ await context.SaveChangesAsync();
+ }
+}
+```
+
+You can also inject dependencies directly into the lambda parameters of [Minimal API](xref:tutorials/min-web-api) endpoints. In the following example, a list of todo items is returned from the `/todos` endpoint. A logger instance for `ILogger` logs information that the code is executed, and the database instance for `AppDbContext` is used to obtain the list of todo items from the database to return them in the response:
+
+```csharp
+app.MapGet("/todos", async (AppDbContext context, ILogger logger) =>
+{
+ logger.LogInformation("Fetching todos using inline handler injection.");
+ var todos = await context.Todos.ToListAsync();
+
+ return Results.Ok(todos);
+});
+```
-In Blazor Web Apps, services are often resolved from DI at run time by using the `@inject` directive in a Razor component, as shown in the following example:
+:::moniker-end
+
+:::moniker range="< aspnetcore-6.0"
+
+When the is called in the `Program` file, a new instance of the class is automatically initialized with [framework-provided services](xref:fundamentals/dependency-injection#framework-provided-services), such as services for configuration and logging:
+
+```csharp
+public static IHostBuilder CreateHostBuilder(string[] args) =>
+ Host.CreateDefaultBuilder(args)
+ .ConfigureWebHostDefaults(webBuilder =>
+ {
+ webBuilder.UseStartup();
+ });
+```
+
+Additional services are added to the DI container's service collection () in the `Startup.ConfigureServices` method (`Startup.cs`). The following example registers MVC and Razor Pages services:
+
+```csharp
+public void ConfigureServices(IServiceCollection services)
+{
+ services.AddControllersWithViews();
+ services.AddRazorPages();
+}
+```
+
+Services are typically resolved from DI using constructor injection. With constructor injection, a class declares a constructor parameter of either the required type or an interface. The DI framework provides an instance of the service at runtime.
+
+:::moniker-end
+
+If the built-in Inversion of Control (IoC) container doesn't meet all of an app's needs, a third-party IoC container can be used instead.
+
+For more information, see the following resources:
+
+*
+*
+
+## Environments
+
+Execution environments are available in ASP.NET Core, such as:
+
+* `Development`: When the app is in local development.
+* `Staging`: When the app is staged for deployment.
+* `Production`: When the live app is running for users.
+
+Specify the environment an app is running in by setting the `ASPNETCORE_ENVIRONMENT` environment variable. ASP.NET Core reads that environment variable at app startup and stores the value to control code execution around the app.
+
+:::moniker range=">= aspnetcore-6.0"
+
+Developer code can check for a given environment. In the following `Program` file example, the code in the execution block only runs when the app is ***not*** running in the `Development` environment:
+
+```csharp
+if (!app.Environment.IsDevelopment())
+{
+ ...
+}
+```
-:::code language="razor" source="~/fundamentals/index/samples/9.0/BlazorWebAppMovies/Components/Pages/MoviePages/Index.razor" highlight ="8,44,48":::
+:::moniker-end
-In the preceding code:
+:::moniker range="< aspnetcore-6.0"
-* The `@inject` directive is used.
-* The service is resolved in the `OnInitialized` method and assigned to the `context` variable.
-* The `context` service creates the `FilteredMovie` list.
+```csharp
+public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
+{
+ if (!env.IsDevelopment())
+ {
+ ...
+ }
-Another way to resolve a service from DI is by using constructor injection. The following Razor Pages code uses constructor injection to resolve the database context and a logger from DI:
+ ...
+}
+```
- :::code language="csharp" source="~/fundamentals/index/samples/6.0/RazorPagesMovie/Pages/Movies/Index.cshtml.cs" id="snippet":::
+:::moniker-end
-In the preceding code, the `IndexModel` constructor takes a parameter of type `RazorPagesMovieContext`, which is resolved at run time into the `_context` variable. The context object is used to create a list of movies in the `OnGetAsync` method.
+For more information, see the following resources:
-For more information, see and .
+*
+*
## Middleware
The request handling pipeline is composed as a series of middleware components. Each component performs operations on an [`HttpContext`](xref:fundamentals/httpcontext) and either invokes the next middleware in the pipeline or terminates the request.
-By convention, a middleware component is added to the pipeline by invoking a `Use{Feature}` extension method. The use of methods named `Use{Feature}` to add middleware to an app is illustrated in the following code:
+By convention, middleware components are added to the pipeline by invoking an extension method that starts with "`Use`." In the following example representing part of a request processing pipeline, middleware for exception handling (), [HTTP Strict Transport Security (HSTS) protocol](xref:security/enforcing-ssl#http-strict-transport-security-hsts-protocol) (), and HTTPS redirection () are called. Two of the middlewares are only triggered when the app isn't under local development in the "`Development`" app execution environment, which means that they run when the app is in other environments, such as when the app is staged for deployment (the `Staging` environment) and in production (the `Production` environment):
+
+:::moniker range=">= aspnetcore-6.0"
+
+```csharp
+if (!app.Environment.IsDevelopment())
+{
+ app.UseExceptionHandler("/Error", createScopeForErrors: true);
+ app.UseHsts();
+}
+
+app.UseHttpsRedirection();
+```
+
+:::moniker-end
+
+:::moniker range="< aspnetcore-6.0"
-:::code language="csharp" source="~/fundamentals/index/samples/9.0/BlazorWebAppMovies/Program.cs" id="snippet_middleware" highlight="26-28,30,32":::
+```csharp
+if (env.IsDevelopment())
+{
+ ...
+}
+else
+{
+ app.UseExceptionHandler("/Error");
+ app.UseHsts();
+}
+
+app.UseHttpsRedirection();
+```
-For more information, see .
+:::moniker-end
+
+ASP.NET Core includes a rich set of built-in middleware. You can also create custom middleware components to meet an app's special request processing specifications. For more information, see .
## Host
@@ -84,33 +322,84 @@ On startup, an ASP.NET Core app builds a *host*. The host encapsulates all of th
* Dependency injection (DI) services
* Configuration
+:::moniker range=">= aspnetcore-6.0"
+
There are three different hosts capable of running an ASP.NET Core app:
-* [ASP.NET Core WebApplication](xref:fundamentals/minimal-apis/webapplication), also known as the [Minimal Host](xref:migration/50-to-60#new-hosting-model)
-* [.NET Generic Host](xref:fundamentals/host/generic-host) combined with ASP.NET Core's
+* [ASP.NET Core WebApplication](xref:fundamentals/minimal-apis/webapplication) (also known as the [Minimal Host](xref:migration/50-to-60#new-hosting-model))
+* [.NET Generic Host](xref:fundamentals/host/generic-host)
* [ASP.NET Core WebHost](xref:fundamentals/host/web-host)
-The ASP.NET Core and types are recommended and are used in all the ASP.NET Core templates. `WebApplication` behaves similarly to the .NET Generic Host and exposes many of the same interfaces but requires fewer callbacks to configure. The ASP.NET Core is available only for backward compatibility.
+The ASP.NET Core and types are recommended and are used in all of the ASP.NET Core project templates. `WebApplication` behaves similarly to the .NET Generic Host and exposes many of the same interfaces but requires fewer callbacks to configure. The ASP.NET Core is only available for backward compatibility.
-The following example instantiates a `WebApplication` and assigns it to a variable named `app`:
+The following example instantiates a and assigns it to a variable named `app`:
-:::code language="csharp" source="~/fundamentals/index/samples/9.0/BlazorWebAppMovies/Program.cs" id="snippet_services" highlight="1,14":::
+```csharp
+var builder = WebApplication.CreateBuilder(args);
-The [WebApplicationBuilder.Build](xref:Microsoft.AspNetCore.Builder.WebApplicationBuilder.Build%2A) method configures a host with a set of default options, such as:
+...
+
+var app = builder.Build();
+```
+
+The method configures a host with a set of default options, such as:
+
+* Using [Kestrel](#servers) as the web server and enabling IIS integration.
+* Loading [configuration](xref:fundamentals/configuration/index) from app settings files (for example, `appsettings.json`), environment variables, command line arguments, and other configuration sources.
+* Setting up logging and directing logging output to the console and debug logging providers.
+
+:::moniker-end
-* Use [Kestrel](#servers) as the web server and enable IIS integration.
-* Load [configuration](xref:fundamentals/configuration/index) from `appsettings.json`, environment variables, command line arguments, and other configuration sources.
-* Send logging output to the console and debug providers.
+:::moniker range="< aspnetcore-6.0"
+
+There are two different hosts:
+
+* [.NET Generic Host](xref:fundamentals/host/generic-host)
+* [ASP.NET Core WebHost](xref:fundamentals/host/web-host)
+
+The .NET Generic Host is recommended. The ASP.NET Core Web Host is only available for backwards compatibility.
+
+The and methods in the following example configure a host with a set of default options, such as:
+
+* Using [Kestrel](#servers) as the web server and enabling IIS integration.
+* Loading [configuration](xref:fundamentals/configuration/index) from app settings files (for example, `appsettings.json`), environment variables, command line arguments, and other configuration sources.
+* Setting up logging and directing logging output to the console and debug logging providers.
+
+```csharp
+public class Program
+{
+ public static void Main(string[] args)
+ {
+ CreateHostBuilder(args).Build().Run();
+ }
+
+ public static IHostBuilder CreateHostBuilder(string[] args) =>
+ Host.CreateDefaultBuilder(args)
+ .ConfigureWebHostDefaults(webBuilder =>
+ {
+ webBuilder.UseStartup();
+ });
+}
+```
+
+:::moniker-end
+
+For more information, see the following resources:
+
+* (*Recommended*)
+* (*For backwards compatibility*)
### Non-web scenarios
-The Generic Host enables other types of apps to use cross-cutting framework extensions, such as logging, dependency injection (DI), configuration, and app lifetime management. For more information, see and .
+The [Generic Host](xref:fundamentals/host/generic-host) enables other types of apps to use cross-cutting framework extensions, such as logging, dependency injection (DI), configuration, and app lifetime management. For more information, see and .
## Servers
An ASP.NET Core app uses an HTTP server implementation to listen for HTTP requests. The server surfaces requests to the app as a set of [request features](xref:fundamentals/request-features) composed into an .
-# [Windows](#tab/windows)
+For more information, see .
+
+### Windows
ASP.NET Core provides the following server implementations:
@@ -118,37 +407,24 @@ ASP.NET Core provides the following server implementations:
* *IIS HTTP Server* is a server for Windows that uses IIS. With this server, the ASP.NET Core app and IIS run in the same process.
* *HTTP.sys* is a server for Windows that isn't used with IIS.
-# [macOS](#tab/macos)
-
-ASP.NET Core provides the *Kestrel* cross-platform server implementation. In ASP.NET Core 2.0 or later, Kestrel can run as a public-facing edge server exposed directly to the Internet. Kestrel is often run in a reverse proxy configuration with [Nginx](https://nginx.org) or [Apache](https://httpd.apache.org/).
-
-# [Linux](#tab/linux)
+### macOS and Linux
ASP.NET Core provides the *Kestrel* cross-platform server implementation. In ASP.NET Core 2.0 or later, Kestrel can run as a public-facing edge server exposed directly to the Internet. Kestrel is often run in a reverse proxy configuration with [Nginx](https://nginx.org) or [Apache](https://httpd.apache.org/).
----
-
-For more information, see .
-
## Configuration
-ASP.NET Core provides a [configuration](xref:fundamentals/configuration/index) framework that gets settings as name-value pairs from an ordered set of configuration providers. Built-in configuration providers are available for a variety of sources, such as `.json` files, `.xml` files, environment variables, and command-line arguments. Write custom configuration providers to support other sources.
-
-By [default](xref:fundamentals/configuration/index#default-app-configuration-sources), ASP.NET Core apps are configured to read from `appsettings.json`, environment variables, the command line, and more. When the app's configuration is loaded, values from environment variables override values from `appsettings.json`.
-
-For managing confidential configuration data such as passwords in the `Development` environment, .NET provides the [Secret Manager](xref:security/app-secrets#secret-manager). For production secrets, we recommend [Azure Key Vault](xref:security/key-vault-configuration).
-
-For more information, see .
+ASP.NET Core provides a [configuration](xref:fundamentals/configuration/index) framework that gets settings as name-value pairs from an ordered set of configuration providers. Built-in configuration providers are available for a variety of sources, such as JSON files (`.json`), XML files (`.xml`), environment variables, and command-line arguments. You can create custom configuration providers to support other sources.
-## Environments
+By default, ASP.NET Core apps are configured to read from app settings files (for example, `appsettings.json`), environment variables, and the command line.
-Execution environments, such as `Development`, `Staging`, and `Production`, are available in ASP.NET Core. Specify the environment an app is running in by setting the `ASPNETCORE_ENVIRONMENT` environment variable. ASP.NET Core reads that environment variable at app startup and stores the value in an `IWebHostEnvironment` implementation. This implementation is available anywhere in an app via dependency injection (DI).
+When the app's configuration is loaded, values from environment variables override values from app settings files. The [Options API](xref:fundamentals/configuration/options) is available for reading related configuration values.
-The following example configures the exception handler and [HTTP Strict Transport Security (HSTS) protocol](xref:security/enforcing-ssl#http-strict-transport-security-hsts-protocol) middleware when ***not*** running in the `Development` environment:
+For managing confidential configuration data such as passwords in the `Development` environment, .NET provides the [Secret Manager](xref:security/app-secrets#secret-manager). For production secrets, we recommend [Azure Key Vault](xref:security/key-vault-configuration).
-:::code language="csharp" source="~/fundamentals/index/samples/9.0/BlazorWebAppMovies/Program.cs" id="snippet_environments" highlight="1":::
+For more information, see the following resources:
-For more information, see .
+*
+*
## Logging
@@ -162,21 +438,43 @@ ASP.NET Core supports a logging API that works with a variety of built-in and th
* Azure App Service
* Azure Application Insights
-To create logs, resolve an service from dependency injection (DI) and call logging methods such as . The following example shows how to get and use a logger in a `.razor` file for a page in a Blazor Web App. A logger object and a console provider for it are stored in the DI container automatically when the method is called in `Program.cs`.
+To create logs, resolve an service from dependency injection (DI) and call logging methods such as . A logger object and a console provider for it are stored in the DI container automatically when the method is called.
-:::code language="csharp" source="~/fundamentals/index/samples/9.0/BlazorWebAppMovies/Components/Pages/Weather.razor" highlight="3,49-51":::
+The following example shows how to obtain a logging instance from DI and use it in a `Weather` component (`Weather.razor`) of a Blazor app that reports weather data:
-For more information, see .
+```razor
+@inject ILogger Logger
+
+...
+
+@code {
+ protected override async Task OnInitializedAsync()
+ {
+ Logger.LogInformation("OnInitializedAsync method called!");
+
+ ...
+ }
+}
+```
+
+For more information, including routing guidance for Razor Pages and MVC apps, see the following resources:
+
+*
+*
## Routing
-Routing in ASP.NET Core is a mechanism that maps incoming requests to specific endpoints in an application. It enables you to define URL patterns that correspond to different components, such as Razor components, Razor pages, MVC controller actions, or middleware.
+Routing in ASP.NET Core is a mechanism that maps incoming requests to specific endpoints in an app. It enables you to define URL patterns that correspond to different components, such as Razor components, Razor pages, MVC controller actions, or middleware.
+
+The method adds routing middleware to the request pipeline. This middleware processes the routing information and determines the appropriate endpoint for each request. In apps using the minimal hosting model (introduced in .NET 6), `UseRouting` isn't explicitly called in developer code unless you want to change the order in which middleware is processed.
-The method adds routing middleware to the request pipeline. This middleware processes the routing information and determines the appropriate endpoint for each request. You don't have to explicitly call `UseRouting` unless you want to change the order in which middleware is processed.
+For more information, see the following resources:
-For more information, see and .
+*
+*
+*
-## Error handling
+## Handle errors
ASP.NET Core has built-in features for handling errors, such as:
@@ -185,55 +483,48 @@ ASP.NET Core has built-in features for handling errors, such as:
* Static status code pages
* Startup exception handling
-For more information, see .
+For more information, see the following resources:
+
+*
+*
## Make HTTP requests
An implementation of is available for creating instances. The factory:
-* Provides a central location for naming and configuring logical `HttpClient` instances. For example, register and configure a *github* client for accessing GitHub. Register and configure a default client for other purposes.
+* Provides a central location for naming and configuring logical `HttpClient` instances. For example, rely on a default client for most of the app's data requests with a web API and register a different configured client for accessing GitHub.
* Supports registration and chaining of multiple delegating handlers to build an outgoing request middleware pipeline. This pattern is similar to ASP.NET Core's inbound middleware pipeline. The pattern provides a mechanism to manage cross-cutting concerns for HTTP requests, including caching, error handling, serialization, and logging.
* Integrates with *Polly*, a popular third-party library for transient fault handling.
* Manages the pooling and lifetime of underlying instances to avoid common DNS problems that occur when managing `HttpClient` lifetimes manually.
* Adds a configurable logging experience via for all requests sent through clients created by the factory.
-For more information, see .
+For more information, see and .
## Content root
The content root is the base path for:
-* The executable hosting the app (*.exe*).
-* Compiled assemblies that make up the app (*.dll*).
+* The executable hosting the app (`.exe`).
+* Compiled assemblies that make up the app (`.dll`).
* Content files used by the app, such as:
* Razor files (`.cshtml`, `.razor`)
* Configuration files (`.json`, `.xml`)
* Data files (`.db`)
* The [Web root](#web-root), typically the `wwwroot` folder.
-During development, the content root defaults to the project's root directory. This directory is also the base path for both the app's content files and the [web root](#web-root). Specify a different content root by setting its path when [building the host](#host). For more information, see [Content root](xref:fundamentals/host/generic-host#contentroot).
+During development, the content root defaults to the project's root directory. This directory is also the base path for both the app's content files and the [web root](#web-root). Specify a different content root by setting its path when [building the host](#host).
-## Web root
-
-The web root is the base path for public, static resource files, such as:
+For more information, see and .
-* Stylesheets (`.css`)
-* JavaScript (`.js`)
-* Images (`.png`, `.jpg`)
+## Web root
-By default, static files are served only from the web root directory and its sub-directories. The web root path defaults to `{CONTENT ROOT}/wwwroot`, where the `{CONTENT ROOT}` placeholder is the content root. Specify a different web root by setting its path when [building the host](#host). For more information, see [Web root](xref:fundamentals/host/generic-host#webroot).
+The web root is the base path for public, static resource files, such as stylesheets, JavaScript files, and images.
-Prevent publishing files in `wwwroot` with the [`` project item](/visualstudio/msbuild/common-msbuild-project-items#content) in the project file. The following example prevents publishing content in `wwwroot/local` and its sub-directories:
-
-```xml
-
-
-
-```
+By default, static files are only served from the web root directory and its sub-directories. The web root path defaults to `{CONTENT ROOT}/wwwroot`, where the `{CONTENT ROOT}` placeholder is the content root. Specify a different web root by setting its path when [building the host](#host). You can also prevent publishing files in `wwwroot` with the [`` project item](/visualstudio/msbuild/common-msbuild-project-items#content) in the app's project file.
In Razor `.cshtml` files, `~/` points to the web root. A path beginning with `~/` is referred to as a *virtual path*.
-For more information, see .
+For more information, see and .
## How to download a sample
@@ -243,7 +534,33 @@ Many of the articles and tutorials include links to sample code.
1. Unzip the `AspNetCore.Docs-main.zip` file.
1. To access an article's sample app in the unzipped repository, use the URL in the article's sample link to help you navigate to the sample's folder. Usually, an article's sample link appears at the top of the article with the link text *View or download sample code*.
-### Preprocessor directives in sample code
+To obtain a single sample app and only its last commit, use [`git sparse-checkout`](https://git-scm.com/docs/git-sparse-checkout).
+
+In the following example for the [Blazor samples GitHub repository](https://github.com/dotnet/blazor-samples), the `git sparse-checkout set` command specifies the path to the sample folder:
+
+* Replace the `{VERSION FOLDER}` placeholder with the version folder.
+* Replace the `{SAMPLE FOLDER}` placeholder with the sample folder.
+
+In a command shell, navigate to the folder where you would like to clone the sample. Execute the following commands in the command shell passing the version/sample folder path to the `git sparse-checkout set` command:
+
+```cli
+git clone --depth 1 --filter=blob:none https://github.com/dotnet/blazor-samples.git --sparse
+cd blazor-samples
+git sparse-checkout init --cone
+git sparse-checkout set {VERSION FOLDER}/{SAMPLE FOLDER}
+```
+
+The following [PowerShell](/powershell/) example obtains the 10.0 Blazor Web App sample and places it in the user's documents folder using PowerShell's `~/documents` path for the change directory (`cd`) command:
+
+```powershell
+cd "~/documents"
+git clone --depth 1 --filter=blob:none https://github.com/dotnet/blazor-samples.git --sparse
+cd blazor-samples
+git sparse-checkout init --cone
+git sparse-checkout set 10.0/BlazorSample_BlazorWebApp
+```
+
+## Preprocessor directives in sample code
To demonstrate multiple scenarios, sample apps use the `#define` and `#if-#else/#elif-#endif` preprocessor directives to selectively compile and run different sections of sample code. For those samples that make use of this approach, set the `#define` directive at the top of the C# files to define the symbol associated with the scenario that you want to run. Some samples require defining the symbol at the top of multiple files in order to run a scenario.
@@ -261,7 +578,7 @@ To change the sample to run the `ExpandDefault` scenario, define the `ExpandDefa
For more information on using [C# preprocessor directives](/dotnet/csharp/language-reference/preprocessor-directives/) to selectively compile sections of code, see [#define (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-define) and [#if (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-if).
-### Regions in sample code
+## Regions in sample code
Some sample apps contain sections of code surrounded by [#region](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-region) and [#endregion](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-endregion) C# directives. The documentation build system injects these regions into the rendered documentation topics.
@@ -287,11 +604,75 @@ You may safely ignore or remove the `#region` and `#endregion` directives that s
For more information, see [Contribute to the ASP.NET documentation: Code snippets](https://github.com/dotnet/AspNetCore.Docs/blob/main/CONTRIBUTING.md#code-snippets).
+## Document Object Model (DOM)
+
+References to the *Document Object Model* throughout this documentation set use the abbreviation *DOM*.
+
+For more information, see the following resources:
+
+* [Introduction to the DOM (MDN documentation)](https://developer.mozilla.org/docs/Web/API/Document_Object_Model/Introduction)
+* [Level 1 Document Object Model Specification (W3C)](https://www.w3.org/TR/WD-DOM/)
+
+## Byte multiples
+
+.NET byte sizes use metric prefixes for non-decimal multiples of bytes based on powers of 1024.
+
+| Name (abbreviation) | Size | Example |
+| ------------------- | ----------------------- | -------------------------- |
+| Kilobyte (KB) | 1,024 bytes | 1 KB = 1,024 bytes |
+| Megabyte (MB) | 1,0242 bytes | 1 MB = 1,048,576 bytes |
+| Gigabyte (GB) | 1,0243 bytes | 1 GB = 1,073,741,824 bytes |
+
+## Support requests
+
+Only documentation-related issues are appropriate for the `dotnet/AspNetCore.Docs` repository. ***For product support, don't open a documentation issue.*** Seek assistance through one or more of the following support channels:
+
+* [Stack Overflow for ASP.NET Core (tagged: `asp.net-core`)](https://stackoverflow.com/questions/tagged/asp.net-core)
+* [Stack Overflow for Blazor (tagged: `blazor`)](https://stackoverflow.com/questions/tagged/blazor)
+* [General ASP.NET Core Slack Team](https://join.slack.com/t/aspnetcore/shared_invite/zt-1mv5487zb-EOZxJ1iqb0A0ajowEbxByQ)
+* [Blazor Gitter](https://gitter.im/aspnet/Blazor)
+
+For a potential bug in the framework or product feedback, open an issue for the ASP.NET Core product unit at [`dotnet/aspnetcore` issues](https://github.com/dotnet/aspnetcore/issues). Bug reports usually ***require*** the following:
+
+* **Clear explanation of the problem**: Follow the instructions in the GitHub issue template provided by the product unit when opening the issue.
+* **Minimal repro project**: Place a project on GitHub for the product unit engineers to download and run. Cross-link the project into the issue's opening comment.
+
+For a potential problem with an article, open a documentation issue. To open a documentation issue, use the **Open a documentation issue** feedback link at the bottom of the article. Metadata added to your issue provides tracking data and automatically pings the author of the article. If the subject was discussed with the product unit prior to opening the documentation issue, place a cross-link to the engineering issue in the documentation issue's opening comment.
+
+GitHub issues for Blazor documentation are automatically marked for triage on the [`Blazor.Docs` project (`dotnet/AspNetCore.Docs` GitHub repository)](https://github.com/dotnet/AspNetCore.Docs/projects/35). Please wait a short while for a response, especially over weekends and holidays. Usually, documentation authors respond within 24 hours on weekdays.
+
+For problems or feedback on Visual Studio, use the [**Report a Problem**](/visualstudio/ide/how-to-report-a-problem-with-visual-studio) or [**Suggest a Feature**](/visualstudio/ide/suggest-a-feature) gestures from within Visual Studio, which open internal issues for Visual Studio. For more information, see [Visual Studio Feedback](https://developercommunity.visualstudio.com/home).
+
+For problems with Visual Studio Code, ask for support on community support forums. For bug reports and product feedback, open an issue on the [`microsoft/vscode` GitHub repo](https://github.com/microsoft/vscode/issues).
+
## Additional resources
-
+:::moniker range=">= aspnetcore-8.0"
+
+* Tutorials
+ *
+ *
+ *
+*
+
+:::moniker-end
+
+:::moniker range=">= aspnetcore-6.0 < aspnetcore-8.0"
+
+* Tutorials
+ *
+ *
+*
:::moniker-end
-[!INCLUDE[](~/fundamentals/index/includes/index3-7.md)]
-[!INCLUDE[](~/fundamentals/index/includes/index8.md)]
+:::moniker range="< aspnetcore-6.0"
+
+* Tutorials
+ *
+ *
+ *
+ *
+*
+
+:::moniker-end
diff --git a/aspnetcore/fundamentals/index/includes/index3-7.md b/aspnetcore/fundamentals/index/includes/index3-7.md
deleted file mode 100644
index fbf7036dfc61..000000000000
--- a/aspnetcore/fundamentals/index/includes/index3-7.md
+++ /dev/null
@@ -1,479 +0,0 @@
-:::moniker range=">= aspnetcore-6.0 < aspnetcore-8.0"
-
-This article provides an overview of the fundamentals for building ASP.NET Core apps, including dependency injection (DI), configuration, middleware, and more.
-
-## Program.cs
-
-ASP.NET Core apps created with the web templates contain the application startup code in the `Program.cs` file. The `Program.cs` file is where:
-
-* Services required by the app are configured.
-* The app's request handling pipeline is defined as a series of [middleware components](xref:fundamentals/middleware/index).
-
-The following app startup code supports:
-
-* [Razor Pages](xref:tutorials/razor-pages/razor-pages-start)
-* [MVC controllers with views](xref:tutorials/first-mvc-app/start-mvc)
-* [Web API with controllers](xref:tutorials/first-web-api)
-* [Minimal web APIs](xref:tutorials/min-web-api)
-
-[!code-csharp[](~/fundamentals/startup/6.0_samples/WebAll/Program.cs?name=snippet)]
-
-## Dependency injection (services)
-
-ASP.NET Core includes [dependency injection (DI)](xref:fundamentals/dependency-injection) that makes configured services available throughout an app. Services are added to the DI container with [WebApplicationBuilder.Services](xref:Microsoft.AspNetCore.Builder.WebApplicationBuilder.Services), `builder.Services` in the preceding code. When the is instantiated, many [framework-provided services](xref:fundamentals/dependency-injection#framework-provided-services) are added. `builder` is a `WebApplicationBuilder` in the following code:
-
-[!code-csharp[](~/fundamentals/startup/6.0_samples/WebAll/Program.cs?name=snippet2&highlight=1)]
-
-In the preceding highlighted code, `builder` has configuration, logging, and [many other services](xref:fundamentals/dependency-injection#framework-provided-services) added to the DI container.
-
-The following code adds Razor Pages, MVC controllers with views, and a custom to the DI container:
-
-[!code-csharp[](~/fundamentals/index/samples/6.0/RazorPagesMovie/Program.cs?name=snippet2&highlight=6-10)]
-
-Services are typically resolved from DI using constructor injection. The DI framework provides an instance of this service at runtime.
-
-The following code uses constructor injection to resolve the database context and logger from DI:
-
-[!code-csharp[](~/fundamentals/index/samples/6.0/RazorPagesMovie/Pages/Movies/Index.cshtml.cs?name=snippet&highlight=3-10, 16-17)]
-
-## Middleware
-
-The request handling pipeline is composed as a series of middleware components. Each component performs operations on an [`HttpContext`](xref:fundamentals/httpcontext) and either invokes the next middleware in the pipeline or terminates the request.
-
-By convention, a middleware component is added to the pipeline by invoking a `Use{Feature}` extension method. Middleware added to the app is highlighted in the following code:
-
-[!code-csharp[](~/fundamentals/startup/6.0_samples/WebAll/Program.cs?name=snippet&highlight=12-19)]
-
-For more information, see .
-
-## Host
-
-On startup, an ASP.NET Core app builds a *host*. The host encapsulates all of the app's resources, such as:
-
-* An HTTP server implementation
-* Middleware components
-* Logging
-* Dependency injection (DI) services
-* Configuration
-
-There are three different hosts capable of running an ASP.NET Core app:
-
-* [ASP.NET Core WebApplication](xref:fundamentals/minimal-apis/webapplication), also known as the [Minimal Host](xref:migration/50-to-60#new-hosting-model)
-* [.NET Generic Host](xref:fundamentals/host/generic-host) combined with ASP.NET Core's
-* [ASP.NET Core WebHost](xref:fundamentals/host/web-host)
-
-The ASP.NET Core and types are recommended and used in all the ASP.NET Core templates. `WebApplication` behaves similarly to the .NET Generic Host and exposes many of the same interfaces but requires less callbacks to configure. The ASP.NET Core is available only for backward compatibility.
-
-The following example instantiates a `WebApplication`:
-
-[!code-csharp[](~/fundamentals/startup/6.0_samples/WebAll/Program.cs?name=snippet2&highlight=7)]
-
-The [WebApplicationBuilder.Build](xref:Microsoft.AspNetCore.Builder.WebApplicationBuilder.Build%2A) method configures a host with a set of default options, such as:
-
-* Use [Kestrel](#servers) as the web server and enable IIS integration.
-* Load [configuration](xref:fundamentals/configuration/index) from `appsettings.json`, environment variables, command line arguments, and other configuration sources.
-* Send logging output to the console and debug providers.
-
-### Non-web scenarios
-
-The Generic Host allows other types of apps to use cross-cutting framework extensions, such as logging, dependency injection (DI), configuration, and app lifetime management. For more information, see and .
-
-## Servers
-
-An ASP.NET Core app uses an HTTP server implementation to listen for HTTP requests. The server surfaces requests to the app as a set of [request features](xref:fundamentals/request-features) composed into an `HttpContext`.
-
-# [Windows](#tab/windows)
-
-ASP.NET Core provides the following server implementations:
-
-* *Kestrel* is a cross-platform web server. Kestrel is often run in a reverse proxy configuration using [IIS](https://www.iis.net/). In ASP.NET Core 2.0 or later, Kestrel can be run as a public-facing edge server exposed directly to the Internet.
-* *IIS HTTP Server* is a server for Windows that uses IIS. With this server, the ASP.NET Core app and IIS run in the same process.
-* *HTTP.sys* is a server for Windows that isn't used with IIS.
-
-# [macOS](#tab/macos)
-
-ASP.NET Core provides the *Kestrel* cross-platform server implementation. In ASP.NET Core 2.0 or later, Kestrel can run as a public-facing edge server exposed directly to the Internet. Kestrel is often run in a reverse proxy configuration with [Nginx](https://nginx.org) or [Apache](https://httpd.apache.org/).
-
-# [Linux](#tab/linux)
-
-ASP.NET Core provides the *Kestrel* cross-platform server implementation. In ASP.NET Core 2.0 or later, Kestrel can run as a public-facing edge server exposed directly to the Internet. Kestrel is often run in a reverse proxy configuration with [Nginx](https://nginx.org) or [Apache](https://httpd.apache.org/).
-
----
-
-For more information, see .
-
-## Configuration
-
-ASP.NET Core provides a [configuration](xref:fundamentals/configuration/index) framework that gets settings as name-value pairs from an ordered set of configuration providers. Built-in configuration providers are available for a variety of sources, such as `.json` files, `.xml` files, environment variables, and command-line arguments. Write custom configuration providers to support other sources.
-
-By [default](xref:fundamentals/configuration/index#default-app-configuration-sources), ASP.NET Core apps are configured to read from `appsettings.json`, environment variables, the command line, and more. When the app's configuration is loaded, values from environment variables override values from `appsettings.json`.
-
-For managing confidential configuration data such as passwords, .NET provides the [Secret Manager](xref:security/app-secrets#secret-manager). For production secrets, we recommend [Azure Key Vault](xref:security/key-vault-configuration).
-
-For more information, see .
-
-## Environments
-
-Execution environments, such as `Development`, `Staging`, and `Production`, are available in ASP.NET Core. Specify the environment an app is running in by setting the `ASPNETCORE_ENVIRONMENT` environment variable. ASP.NET Core reads that environment variable at app startup and stores the value in an `IWebHostEnvironment` implementation. This implementation is available anywhere in an app via dependency injection (DI).
-
-The following example configures the exception handler and [HTTP Strict Transport Security (HSTS) protocol](xref:security/enforcing-ssl#http-strict-transport-security-hsts-protocol) middleware when ***not*** running in the `Development` environment:
-
-[!code-csharp[](~/fundamentals/startup/6.0_samples/WebAll/Program.cs?name=snippet&highlight=10-14)]
-
-For more information, see .
-
-## Logging
-
-ASP.NET Core supports a logging API that works with a variety of built-in and third-party logging providers. Available providers include:
-
-* Console
-* Debug
-* Event Tracing on Windows
-* Windows Event Log
-* TraceSource
-* Azure App Service
-* Azure Application Insights
-
-To create logs, resolve an service from dependency injection (DI) and call logging methods such as . For example:
-
-[!code-csharp[](~/fundamentals/index/samples/6.0/RazorPagesMovie/Pages/Movies/Index.cshtml.cs?name=snippet&highlight=3-10, 16-17)]
-
-For more information, see .
-
-## Routing
-
-A *route* is a URL pattern that is mapped to a handler. The handler is typically a Razor page, an action method in an MVC controller, or a middleware. ASP.NET Core routing gives you control over the URLs used by your app.
-
-The following code, generated by the ASP.NET Core web application template, calls :
-
-[!code-csharp[](~/fundamentals/startup/6.0_samples/WebAll/Program.cs?name=snippet4&highlight=17)]
-
-For more information, see .
-
-## Error handling
-
-ASP.NET Core has built-in features for handling errors, such as:
-
-* A developer exception page
-* Custom error pages
-* Static status code pages
-* Startup exception handling
-
-For more information, see .
-
-## Make HTTP requests
-
-An implementation of `IHttpClientFactory` is available for creating `HttpClient` instances. The factory:
-
-* Provides a central location for naming and configuring logical `HttpClient` instances. For example, register and configure a *github* client for accessing GitHub. Register and configure a default client for other purposes.
-* Supports registration and chaining of multiple delegating handlers to build an outgoing request middleware pipeline. This pattern is similar to ASP.NET Core's inbound middleware pipeline. The pattern provides a mechanism to manage cross-cutting concerns for HTTP requests, including caching, error handling, serialization, and logging.
-* Integrates with *Polly*, a popular third-party library for transient fault handling.
-* Manages the pooling and lifetime of underlying `HttpClientHandler` instances to avoid common DNS problems that occur when managing `HttpClient` lifetimes manually.
-* Adds a configurable logging experience via for all requests sent through clients created by the factory.
-
-For more information, see .
-
-## Content root
-
-The content root is the base path for:
-
-* The executable hosting the app (*.exe*).
-* Compiled assemblies that make up the app (*.dll*).
-* Content files used by the app, such as:
- * Razor files (`.cshtml`, `.razor`)
- * Configuration files (`.json`, `.xml`)
- * Data files (`.db`)
-* The [Web root](#web-root), typically the *wwwroot* folder.
-
-During development, the content root defaults to the project's root directory. This directory is also the base path for both the app's content files and the [Web root](#web-root). Specify a different content root by setting its path when [building the host](#host). For more information, see [Content root](xref:fundamentals/host/generic-host#contentroot).
-
-## Web root
-
-The web root is the base path for public, static resource files, such as:
-
-* Stylesheets (`.css`)
-* JavaScript (`.js`)
-* Images (`.png`, `.jpg`)
-
-By default, static files are served only from the web root directory and its sub-directories. The web root path defaults to *{content root}/wwwroot*. Specify a different web root by setting its path when [building the host](#host). For more information, see [Web root](xref:fundamentals/host/generic-host#webroot).
-
-Prevent publishing files in *wwwroot* with the [\ project item](/visualstudio/msbuild/common-msbuild-project-items#content) in the project file. The following example prevents publishing content in *wwwroot/local* and its sub-directories:
-
-```xml
-
-
-
-```
-
-In Razor `.cshtml` files, `~/` points to the web root. A path beginning with `~/` is referred to as a *virtual path*.
-
-For more information, see .
-
-:::moniker-end
-
-:::moniker range="< aspnetcore-6.0"
-
-This article provides an overview of the fundamentals for building ASP.NET Core apps, including dependency injection (DI), configuration, middleware, and more.
-
-## The Startup class
-
-The `Startup` class is where:
-
-* Services required by the app are configured.
-* The app's request handling pipeline is defined, as a series of middleware components.
-
-Here's a sample `Startup` class:
-
-[!code-csharp[](~/fundamentals/index/samples_snapshot/3.x/Startup.cs?highlight=3,12)]
-
-For more information, see .
-
-## Dependency injection (services)
-
-ASP.NET Core includes a built-in dependency injection (DI) framework that makes configured services available throughout an app. For example, a logging component is a service.
-
-Code to configure (or *register*) services is added to the `Startup.ConfigureServices` method. For example:
-
-[!code-csharp[](~/fundamentals/index/samples_snapshot/3.x/ConfigureServices.cs)]
-
-Services are typically resolved from DI using constructor injection. With constructor injection, a class declares a constructor parameter of either the required type or an interface. The DI framework provides an instance of this service at runtime.
-
-The following example uses constructor injection to resolve a `RazorPagesMovieContext` from DI:
-
-[!code-csharp[](~/fundamentals/index/samples_snapshot/3.x/Index.cshtml.cs?highlight=5)]
-
-If the built-in Inversion of Control (IoC) container doesn't meet all of an app's needs, a third-party IoC container can be used instead.
-
-For more information, see .
-
-## Middleware
-
-The request handling pipeline is composed as a series of middleware components. Each component performs operations on an `HttpContext` and either invokes the next middleware in the pipeline or terminates the request.
-
-By convention, a middleware component is added to the pipeline by invoking a `Use...` extension method in the `Startup.Configure` method. For example, to enable rendering of static files, call `UseStaticFiles`.
-
-The following example configures a request handling pipeline:
-
-[!code-csharp[](~/fundamentals/index/samples_snapshot/3.x/Configure.cs)]
-
-ASP.NET Core includes a rich set of built-in middleware. Custom middleware components can also be written.
-
-For more information, see .
-
-## Host
-
-On startup, an ASP.NET Core app builds a *host*. The host encapsulates all of the app's resources, such as:
-
-* An HTTP server implementation
-* Middleware components
-* Logging
-* Dependency injection (DI) services
-* Configuration
-
-There are two different hosts:
-
-* .NET Generic Host
-* ASP.NET Core Web Host
-
-The .NET Generic Host is recommended. The ASP.NET Core Web Host is available only for backwards compatibility.
-
-The following example creates a .NET Generic Host:
-
-[!code-csharp[](~/fundamentals/index/samples_snapshot/3.x/Program.cs)]
-
-The `CreateDefaultBuilder` and `ConfigureWebHostDefaults` methods configure a host with a set of default options, such as:
-
-* Use [Kestrel](#servers) as the web server and enable IIS integration.
-* Load configuration from `appsettings.json`, `appsettings.{Environment}.json`, environment variables, command line arguments, and other configuration sources.
-* Send logging output to the console and debug providers.
-
-For more information, see .
-
-### Non-web scenarios
-
-The Generic Host allows other types of apps to use cross-cutting framework extensions, such as logging, dependency injection (DI), configuration, and app lifetime management. For more information, see and .
-
-## Servers
-
-An ASP.NET Core app uses an HTTP server implementation to listen for HTTP requests. The server surfaces requests to the app as a set of [request features](xref:fundamentals/request-features) composed into an `HttpContext`.
-
-# [Windows](#tab/windows)
-
-ASP.NET Core provides the following server implementations:
-
-* *Kestrel* is a cross-platform web server. Kestrel is often run in a reverse proxy configuration using [IIS](https://www.iis.net/). In ASP.NET Core 2.0 or later, Kestrel can be run as a public-facing edge server exposed directly to the Internet.
-* *IIS HTTP Server* is a server for Windows that uses IIS. With this server, the ASP.NET Core app and IIS run in the same process.
-* *HTTP.sys* is a server for Windows that isn't used with IIS.
-
-# [macOS](#tab/macos)
-
-ASP.NET Core provides the *Kestrel* cross-platform server implementation. In ASP.NET Core 2.0 or later, Kestrel can run as a public-facing edge server exposed directly to the Internet. Kestrel is often run in a reverse proxy configuration with [Nginx](https://nginx.org) or [Apache](https://httpd.apache.org/).
-
-# [Linux](#tab/linux)
-
-ASP.NET Core provides the *Kestrel* cross-platform server implementation. In ASP.NET Core 2.0 or later, Kestrel can run as a public-facing edge server exposed directly to the Internet. Kestrel is often run in a reverse proxy configuration with [Nginx](https://nginx.org) or [Apache](https://httpd.apache.org/).
-
----
-
-For more information, see .
-
-## Configuration
-
-ASP.NET Core provides a configuration framework that gets settings as name-value pairs from an ordered set of configuration providers. Built-in configuration providers are available for a variety of sources, such as `.json` files, `.xml` files, environment variables, and command-line arguments. Write custom configuration providers to support other sources.
-
-By [default](xref:fundamentals/configuration/index#default-app-configuration-sources), ASP.NET Core apps are configured to read from `appsettings.json`, environment variables, the command line, and more. When the app's configuration is loaded, values from environment variables override values from `appsettings.json`.
-
-The preferred way to read related configuration values is using the [options pattern](xref:fundamentals/configuration/options).
-
-For managing confidential configuration data such as passwords, .NET provides the [Secret Manager](xref:security/app-secrets#secret-manager). For production secrets, we recommend [Azure Key Vault](xref:security/key-vault-configuration).
-
-For more information, see .
-
-## Environments
-
-Execution environments, such as `Development`, `Staging`, and `Production`, are a first-class notion in ASP.NET Core. Specify the environment an app is running in by setting the `ASPNETCORE_ENVIRONMENT` environment variable. ASP.NET Core reads that environment variable at app startup and stores the value in an `IWebHostEnvironment` implementation. This implementation is available anywhere in an app via dependency injection (DI).
-
-The following example configures the app to provide detailed error information when running in the `Development` environment:
-
-[!code-csharp[](~/fundamentals/index/samples_snapshot/3.x/StartupConfigure.cs?highlight=3-6)]
-
-For more information, see .
-
-## Logging
-
-ASP.NET Core supports a logging API that works with a variety of built-in and third-party logging providers. Available providers include:
-
-* Console
-* Debug
-* Event Tracing on Windows
-* Windows Event Log
-* TraceSource
-* Azure App Service
-* Azure Application Insights
-
-To create logs, resolve an service from dependency injection (DI) and call logging methods such as . For example:
-
-[!code-csharp[](~/fundamentals/index/samples_snapshot/3.x/TodoController.cs?highlight=5,13,19)]
-
-Logging methods such as `LogInformation` support any number of fields. These fields are commonly used to construct a message `string`, but some logging providers send these to a data store as separate fields. This feature makes it possible for logging providers to implement [semantic logging, also known as structured logging](https://softwareengineering.stackexchange.com/questions/312197/benefits-of-structured-logging-vs-basic-logging).
-
-For more information, see .
-
-## Routing
-
-A *route* is a URL pattern that is mapped to a handler. The handler is typically a Razor page, an action method in an MVC controller, or a middleware. ASP.NET Core routing gives you control over the URLs used by your app.
-
-For more information, see .
-
-## Error handling
-
-ASP.NET Core has built-in features for handling errors, such as:
-
-* A developer exception page
-* Custom error pages
-* Static status code pages
-* Startup exception handling
-
-For more information, see .
-
-## Make HTTP requests
-
-An implementation of `IHttpClientFactory` is available for creating `HttpClient` instances. The factory:
-
-* Provides a central location for naming and configuring logical `HttpClient` instances. For example, register and configure a *github* client for accessing GitHub. Register and configure a default client for other purposes.
-* Supports registration and chaining of multiple delegating handlers to build an outgoing request middleware pipeline. This pattern is similar to ASP.NET Core's inbound middleware pipeline. The pattern provides a mechanism to manage cross-cutting concerns for HTTP requests, including caching, error handling, serialization, and logging.
-* Integrates with *Polly*, a popular third-party library for transient fault handling.
-* Manages the pooling and lifetime of underlying `HttpClientHandler` instances to avoid common DNS problems that occur when managing `HttpClient` lifetimes manually.
-* Adds a configurable logging experience via for all requests sent through clients created by the factory.
-
-For more information, see .
-
-## Content root
-
-The content root is the base path for:
-
-* The executable hosting the app (*.exe*).
-* Compiled assemblies that make up the app (*.dll*).
-* Content files used by the app, such as:
- * Razor files (`.cshtml`, `.razor`)
- * Configuration files (`.json`, `.xml`)
- * Data files (`.db`)
-* The [Web root](#web-root), typically the *wwwroot* folder.
-
-During development, the content root defaults to the project's root directory. This directory is also the base path for both the app's content files and the [Web root](#web-root). Specify a different content root by setting its path when [building the host](#host). For more information, see [Content root](xref:fundamentals/host/generic-host#contentroot).
-
-## Web root
-
-The web root is the base path for public, static resource files, such as:
-
-* Stylesheets (`.css`)
-* JavaScript (`.js`)
-* Images (`.png`, `.jpg`)
-
-By default, static files are served only from the web root directory and its sub-directories. The web root path defaults to *{content root}/wwwroot*. Specify a different web root by setting its path when [building the host](#host). For more information, see [Web root](xref:fundamentals/host/generic-host#webroot).
-
-Prevent publishing files in *wwwroot* with the [\ project item](/visualstudio/msbuild/common-msbuild-project-items#content) in the project file. The following example prevents publishing content in *wwwroot/local* and its sub-directories:
-
-```xml
-
-
-
-```
-
-In Razor `.cshtml` files, tilde-slash (`~/`) points to the web root. A path beginning with `~/` is referred to as a *virtual path*.
-
-For more information, see .
-
-## How to download a sample
-
-Many of the articles and tutorials include links to sample code.
-
-1. [Download the ASP.NET repository zip file](https://codeload.github.com/dotnet/AspNetCore.Docs/zip/main).
-1. Unzip the `AspNetCore.Docs-main.zip` file.
-1. To access an article's sample app in the unzipped repository, use the URL in the article's sample link to help you navigate to the sample's folder. Usually, an article's sample link appears at the top of the article with the link text *View or download sample code*.
-
-### Preprocessor directives in sample code
-
-To demonstrate multiple scenarios, sample apps use the `#define` and `#if-#else/#elif-#endif` preprocessor directives to selectively compile and run different sections of sample code. For those samples that make use of this approach, set the `#define` directive at the top of the C# files to define the symbol associated with the scenario that you want to run. Some samples require defining the symbol at the top of multiple files in order to run a scenario.
-
-For example, the following `#define` symbol list indicates that four scenarios are available (one scenario per symbol). The current sample configuration runs the `TemplateCode` scenario:
-
-```csharp
-#define TemplateCode // or LogFromMain or ExpandDefault or FilterInCode
-```
-
-To change the sample to run the `ExpandDefault` scenario, define the `ExpandDefault` symbol and leave the remaining symbols commented-out:
-
-```csharp
-#define ExpandDefault // TemplateCode or LogFromMain or FilterInCode
-```
-
-For more information on using [C# preprocessor directives](/dotnet/csharp/language-reference/preprocessor-directives/) to selectively compile sections of code, see [#define (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-define) and [#if (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-if).
-
-### Regions in sample code
-
-Some sample apps contain sections of code surrounded by [#region](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-region) and [#endregion](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-endregion) C# directives. The documentation build system injects these regions into the rendered documentation topics.
-
-Region names usually contain the word "snippet." The following example shows a region named `snippet_WebHostDefaults`:
-
-```csharp
-#region snippet_WebHostDefaults
-Host.CreateDefaultBuilder(args)
- .ConfigureWebHostDefaults(webBuilder =>
- {
- webBuilder.UseStartup();
- });
-#endregion
-```
-
-The preceding C# code snippet is referenced in the topic's markdown file with the following line:
-
-```md
-[!code-csharp[](sample/SampleApp/Program.cs?name=snippet_WebHostDefaults)]
-```
-
-You may safely ignore or remove the `#region` and `#endregion` directives that surround the code. Don't alter the code within these directives if you plan to run the sample scenarios described in the topic.
-
-For more information, see [Contribute to the ASP.NET documentation: Code snippets](https://github.com/dotnet/AspNetCore.Docs/blob/main/CONTRIBUTING.md#code-snippets).
-
-:::moniker-end
diff --git a/aspnetcore/fundamentals/index/includes/index8.md b/aspnetcore/fundamentals/index/includes/index8.md
deleted file mode 100644
index 0ec241984fc7..000000000000
--- a/aspnetcore/fundamentals/index/includes/index8.md
+++ /dev/null
@@ -1,266 +0,0 @@
-:::moniker range="= aspnetcore-8.0"
-
-This article provides an overview of the fundamentals for building ASP.NET Core apps, including dependency injection (DI), configuration, middleware, and more.
-
-For Blazor fundamentals guidance, which adds to or supersedes the guidance in this node, see .
-
-## Program.cs
-
-ASP.NET Core apps created with the web templates contain the application startup code in the `Program.cs` file. The `Program.cs` file is where:
-
-* Services required by the app are configured.
-* The app's request handling pipeline is defined as a series of [middleware components](xref:fundamentals/middleware/index).
-
-The following app startup code supports:
-
-* [Razor Pages](xref:tutorials/razor-pages/razor-pages-start)
-* [MVC controllers with views](xref:tutorials/first-mvc-app/start-mvc)
-* [Web API with controllers](xref:tutorials/first-web-api)
-* [Minimal web APIs](xref:tutorials/min-web-api)
-
-[!code-csharp[](~/fundamentals/startup/6.0_samples/WebAll/Program.cs?name=snippet)]
-
-## Dependency injection (services)
-
-ASP.NET Core includes [dependency injection (DI)](xref:fundamentals/dependency-injection) that makes configured services available throughout an app. Services are added to the DI container with [WebApplicationBuilder.Services](xref:Microsoft.AspNetCore.Builder.WebApplicationBuilder.Services), `builder.Services` in the preceding code. When the is instantiated, many [framework-provided services](xref:fundamentals/dependency-injection#framework-provided-services) are added. `builder` is a `WebApplicationBuilder` in the following code:
-
-[!code-csharp[](~/fundamentals/startup/6.0_samples/WebAll/Program.cs?name=snippet2&highlight=1)]
-
-In the preceding highlighted code, `builder` has configuration, logging, and [many other services](xref:fundamentals/dependency-injection#framework-provided-services) added to the DI container.
-
-The following code adds Razor Pages, MVC controllers with views, and a custom to the DI container:
-
-[!code-csharp[](~/fundamentals/index/samples/6.0/RazorPagesMovie/Program.cs?name=snippet2&highlight=6-10)]
-
-Services are typically resolved from DI using constructor injection. The DI framework provides an instance of this service at runtime.
-
-The following code uses constructor injection to resolve the database context and logger from DI:
-
-[!code-csharp[](~/fundamentals/index/samples/6.0/RazorPagesMovie/Pages/Movies/Index.cshtml.cs?name=snippet&highlight=3-10, 16-17)]
-
-## Middleware
-
-The request handling pipeline is composed as a series of middleware components. Each component performs operations on an [`HttpContext`](xref:fundamentals/httpcontext) and either invokes the next middleware in the pipeline or terminates the request.
-
-By convention, a middleware component is added to the pipeline by invoking a `Use{Feature}` extension method. Middleware added to the app is highlighted in the following code:
-
-[!code-csharp[](~/fundamentals/startup/6.0_samples/WebAll/Program.cs?name=snippet&highlight=12-19)]
-
-For more information, see .
-
-## Host
-
-On startup, an ASP.NET Core app builds a *host*. The host encapsulates all of the app's resources, such as:
-
-* An HTTP server implementation
-* Middleware components
-* Logging
-* Dependency injection (DI) services
-* Configuration
-
-There are three different hosts capable of running an ASP.NET Core app:
-
-* [ASP.NET Core WebApplication](xref:fundamentals/minimal-apis/webapplication), also known as the [Minimal Host](xref:migration/50-to-60#new-hosting-model)
-* [.NET Generic Host](xref:fundamentals/host/generic-host) combined with ASP.NET Core's
-* [ASP.NET Core WebHost](xref:fundamentals/host/web-host)
-
-The ASP.NET Core and types are recommended and used in all the ASP.NET Core templates. `WebApplication` behaves similarly to the .NET Generic Host and exposes many of the same interfaces but requires less callbacks to configure. The ASP.NET Core is available only for backward compatibility.
-
-The following example instantiates a `WebApplication`:
-
-[!code-csharp[](~/fundamentals/startup/6.0_samples/WebAll/Program.cs?name=snippet2&highlight=7)]
-
-The [WebApplicationBuilder.Build](xref:Microsoft.AspNetCore.Builder.WebApplicationBuilder.Build%2A) method configures a host with a set of default options, such as:
-
-* Use [Kestrel](#servers) as the web server and enable IIS integration.
-* Load [configuration](xref:fundamentals/configuration/index) from `appsettings.json`, environment variables, command line arguments, and other configuration sources.
-* Send logging output to the console and debug providers.
-
-### Non-web scenarios
-
-The Generic Host allows other types of apps to use cross-cutting framework extensions, such as logging, dependency injection (DI), configuration, and app lifetime management. For more information, see and .
-
-## Servers
-
-An ASP.NET Core app uses an HTTP server implementation to listen for HTTP requests. The server surfaces requests to the app as a set of [request features](xref:fundamentals/request-features) composed into an `HttpContext`.
-
-# [Windows](#tab/windows)
-
-ASP.NET Core provides the following server implementations:
-
-* *Kestrel* is a cross-platform web server. Kestrel is often run in a reverse proxy configuration using [IIS](https://www.iis.net/). In ASP.NET Core 2.0 or later, Kestrel can be run as a public-facing edge server exposed directly to the Internet.
-* *IIS HTTP Server* is a server for Windows that uses IIS. With this server, the ASP.NET Core app and IIS run in the same process.
-* *HTTP.sys* is a server for Windows that isn't used with IIS.
-
-# [macOS](#tab/macos)
-
-ASP.NET Core provides the *Kestrel* cross-platform server implementation. In ASP.NET Core 2.0 or later, Kestrel can run as a public-facing edge server exposed directly to the Internet. Kestrel is often run in a reverse proxy configuration with [Nginx](https://nginx.org) or [Apache](https://httpd.apache.org/).
-
-# [Linux](#tab/linux)
-
-ASP.NET Core provides the *Kestrel* cross-platform server implementation. In ASP.NET Core 2.0 or later, Kestrel can run as a public-facing edge server exposed directly to the Internet. Kestrel is often run in a reverse proxy configuration with [Nginx](https://nginx.org) or [Apache](https://httpd.apache.org/).
-
----
-
-For more information, see .
-
-## Configuration
-
-ASP.NET Core provides a [configuration](xref:fundamentals/configuration/index) framework that gets settings as name-value pairs from an ordered set of configuration providers. Built-in configuration providers are available for a variety of sources, such as `.json` files, `.xml` files, environment variables, and command-line arguments. Write custom configuration providers to support other sources.
-
-By [default](xref:fundamentals/configuration/index#default-app-configuration-sources), ASP.NET Core apps are configured to read from `appsettings.json`, environment variables, the command line, and more. When the app's configuration is loaded, values from environment variables override values from `appsettings.json`.
-
-For managing confidential configuration data such as passwords, .NET provides the [Secret Manager](xref:security/app-secrets#secret-manager). For production secrets, we recommend [Azure Key Vault](xref:security/key-vault-configuration).
-
-For more information, see .
-
-## Environments
-
-Execution environments, such as `Development`, `Staging`, and `Production`, are available in ASP.NET Core. Specify the environment an app is running in by setting the `ASPNETCORE_ENVIRONMENT` environment variable. ASP.NET Core reads that environment variable at app startup and stores the value in an `IWebHostEnvironment` implementation. This implementation is available anywhere in an app via dependency injection (DI).
-
-The following example configures the exception handler and [HTTP Strict Transport Security (HSTS) protocol](xref:security/enforcing-ssl#http-strict-transport-security-hsts-protocol) middleware when ***not*** running in the `Development` environment:
-
-[!code-csharp[](~/fundamentals/startup/6.0_samples/WebAll/Program.cs?name=snippet&highlight=10-14)]
-
-For more information, see .
-
-## Logging
-
-ASP.NET Core supports a logging API that works with a variety of built-in and third-party logging providers. Available providers include:
-
-* Console
-* Debug
-* Event Tracing on Windows
-* Windows Event Log
-* TraceSource
-* Azure App Service
-* Azure Application Insights
-
-To create logs, resolve an service from dependency injection (DI) and call logging methods such as . For example:
-
-[!code-csharp[](~/fundamentals/index/samples/6.0/RazorPagesMovie/Pages/Movies/Index.cshtml.cs?name=snippet&highlight=3-10, 16-17)]
-
-For more information, see .
-
-## Routing
-
-A *route* is a URL pattern that is mapped to a handler. The handler is typically a Razor page, an action method in an MVC controller, or a middleware. ASP.NET Core routing gives you control over the URLs used by your app.
-
-The following code, generated by the ASP.NET Core web application template, calls :
-
-[!code-csharp[](~/fundamentals/startup/6.0_samples/WebAll/Program.cs?name=snippet4&highlight=17)]
-
-For more information, see .
-
-## Error handling
-
-ASP.NET Core has built-in features for handling errors, such as:
-
-* A developer exception page
-* Custom error pages
-* Static status code pages
-* Startup exception handling
-
-For more information, see .
-
-## Make HTTP requests
-
-An implementation of `IHttpClientFactory` is available for creating `HttpClient` instances. The factory:
-
-* Provides a central location for naming and configuring logical `HttpClient` instances. For example, register and configure a *github* client for accessing GitHub. Register and configure a default client for other purposes.
-* Supports registration and chaining of multiple delegating handlers to build an outgoing request middleware pipeline. This pattern is similar to ASP.NET Core's inbound middleware pipeline. The pattern provides a mechanism to manage cross-cutting concerns for HTTP requests, including caching, error handling, serialization, and logging.
-* Integrates with *Polly*, a popular third-party library for transient fault handling.
-* Manages the pooling and lifetime of underlying `HttpClientHandler` instances to avoid common DNS problems that occur when managing `HttpClient` lifetimes manually.
-* Adds a configurable logging experience via for all requests sent through clients created by the factory.
-
-For more information, see .
-
-## Content root
-
-The content root is the base path for:
-
-* The executable hosting the app (*.exe*).
-* Compiled assemblies that make up the app (*.dll*).
-* Content files used by the app, such as:
- * Razor files (`.cshtml`, `.razor`)
- * Configuration files (`.json`, `.xml`)
- * Data files (`.db`)
-* The [Web root](#web-root), typically the *wwwroot* folder.
-
-During development, the content root defaults to the project's root directory. This directory is also the base path for both the app's content files and the [Web root](#web-root). Specify a different content root by setting its path when [building the host](#host). For more information, see [Content root](xref:fundamentals/host/generic-host#contentroot).
-
-## Web root
-
-The web root is the base path for public, static resource files, such as:
-
-* Stylesheets (`.css`)
-* JavaScript (`.js`)
-* Images (`.png`, `.jpg`)
-
-By default, static files are served only from the web root directory and its sub-directories. The web root path defaults to *{content root}/wwwroot*. Specify a different web root by setting its path when [building the host](#host). For more information, see [Web root](xref:fundamentals/host/generic-host#webroot).
-
-Prevent publishing files in *wwwroot* with the [\ project item](/visualstudio/msbuild/common-msbuild-project-items#content) in the project file. The following example prevents publishing content in *wwwroot/local* and its sub-directories:
-
-```xml
-
-
-
-```
-
-In Razor `.cshtml` files, `~/` points to the web root. A path beginning with `~/` is referred to as a *virtual path*.
-
-For more information, see .
-
-## How to download a sample
-
-Many of the articles and tutorials include links to sample code.
-
-1. [Download the ASP.NET repository zip file](https://codeload.github.com/dotnet/AspNetCore.Docs/zip/main).
-1. Unzip the `AspNetCore.Docs-main.zip` file.
-1. To access an article's sample app in the unzipped repository, use the URL in the article's sample link to help you navigate to the sample's folder. Usually, an article's sample link appears at the top of the article with the link text *View or download sample code*.
-
-### Preprocessor directives in sample code
-
-To demonstrate multiple scenarios, sample apps use the `#define` and `#if-#else/#elif-#endif` preprocessor directives to selectively compile and run different sections of sample code. For those samples that make use of this approach, set the `#define` directive at the top of the C# files to define the symbol associated with the scenario that you want to run. Some samples require defining the symbol at the top of multiple files in order to run a scenario.
-
-For example, the following `#define` symbol list indicates that four scenarios are available (one scenario per symbol). The current sample configuration runs the `TemplateCode` scenario:
-
-```csharp
-#define TemplateCode // or LogFromMain or ExpandDefault or FilterInCode
-```
-
-To change the sample to run the `ExpandDefault` scenario, define the `ExpandDefault` symbol and leave the remaining symbols commented-out:
-
-```csharp
-#define ExpandDefault // TemplateCode or LogFromMain or FilterInCode
-```
-
-For more information on using [C# preprocessor directives](/dotnet/csharp/language-reference/preprocessor-directives/) to selectively compile sections of code, see [#define (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-define) and [#if (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-if).
-
-### Regions in sample code
-
-Some sample apps contain sections of code surrounded by [#region](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-region) and [#endregion](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-endregion) C# directives. The documentation build system injects these regions into the rendered documentation topics.
-
-Region names usually contain the word "snippet." The following example shows a region named `snippet_WebHostDefaults`:
-
-```csharp
-#region snippet_WebHostDefaults
-Host.CreateDefaultBuilder(args)
- .ConfigureWebHostDefaults(webBuilder =>
- {
- webBuilder.UseStartup();
- });
-#endregion
-```
-
-The preceding C# code snippet is referenced in the topic's markdown file with the following line:
-
-```md
-[!code-csharp[](sample/SampleApp/Program.cs?name=snippet_WebHostDefaults)]
-```
-
-You may safely ignore or remove the `#region` and `#endregion` directives that surround the code. Don't alter the code within these directives if you plan to run the sample scenarios described in the topic.
-
-For more information, see [Contribute to the ASP.NET documentation: Code snippets](https://github.com/dotnet/AspNetCore.Docs/blob/main/CONTRIBUTING.md#code-snippets).
-
-:::moniker-end
diff --git a/aspnetcore/fundamentals/index/samples/6.0/RazorPagesMovie/Data/RazorPagesMovieContext.cs b/aspnetcore/fundamentals/index/samples/6.0/RazorPagesMovie/Data/RazorPagesMovieContext.cs
deleted file mode 100644
index bf6d89b2d4c6..000000000000
--- a/aspnetcore/fundamentals/index/samples/6.0/RazorPagesMovie/Data/RazorPagesMovieContext.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using Microsoft.EntityFrameworkCore;
-using RazorPagesMovie.Models;
-
-namespace RazorPagesMovie.Data
-{
- public class RazorPagesMovieContext : DbContext
- {
- public RazorPagesMovieContext (DbContextOptions options)
- : base(options)
- {
- }
-
- public DbSet Movie { get; set; }
- }
-}
diff --git a/aspnetcore/fundamentals/index/samples/6.0/RazorPagesMovie/Migrations/20211215033815_InitialCreate.Designer.cs b/aspnetcore/fundamentals/index/samples/6.0/RazorPagesMovie/Migrations/20211215033815_InitialCreate.Designer.cs
deleted file mode 100644
index a1dad405dbe3..000000000000
--- a/aspnetcore/fundamentals/index/samples/6.0/RazorPagesMovie/Migrations/20211215033815_InitialCreate.Designer.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-using System;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Metadata;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using RazorPagesMovie.Data;
-
-#nullable disable
-
-namespace RazorPagesMovie.Migrations
-{
- [DbContext(typeof(RazorPagesMovieContext))]
- [Migration("20211215033815_InitialCreate")]
- partial class InitialCreate
- {
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "6.0.1")
- .HasAnnotation("Relational:MaxIdentifierLength", 128);
-
- SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
-
- modelBuilder.Entity("RazorPagesMovie.Models.Movie", b =>
- {
- b.Property("ID")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ID"), 1L, 1);
-
- b.Property("Genre")
- .IsRequired()
- .HasColumnType("nvarchar(max)");
-
- b.Property("Price")
- .HasColumnType("decimal(18,2)");
-
- b.Property("ReleaseDate")
- .HasColumnType("datetime2");
-
- b.Property("Title")
- .IsRequired()
- .HasColumnType("nvarchar(max)");
-
- b.HasKey("ID");
-
- b.ToTable("Movie");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/aspnetcore/fundamentals/index/samples/6.0/RazorPagesMovie/Migrations/20211215033815_InitialCreate.cs b/aspnetcore/fundamentals/index/samples/6.0/RazorPagesMovie/Migrations/20211215033815_InitialCreate.cs
deleted file mode 100644
index bf1899554695..000000000000
--- a/aspnetcore/fundamentals/index/samples/6.0/RazorPagesMovie/Migrations/20211215033815_InitialCreate.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace RazorPagesMovie.Migrations
-{
- public partial class InitialCreate : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "Movie",
- columns: table => new
- {
- ID = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Title = table.Column(type: "nvarchar(max)", nullable: false),
- ReleaseDate = table.Column(type: "datetime2", nullable: false),
- Genre = table.Column(type: "nvarchar(max)", nullable: false),
- Price = table.Column(type: "decimal(18,2)", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Movie", x => x.ID);
- });
- }
-
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "Movie");
- }
- }
-}
diff --git a/aspnetcore/fundamentals/index/samples/6.0/RazorPagesMovie/Migrations/RazorPagesMovieContextModelSnapshot.cs b/aspnetcore/fundamentals/index/samples/6.0/RazorPagesMovie/Migrations/RazorPagesMovieContextModelSnapshot.cs
deleted file mode 100644
index a19d40fb9ce2..000000000000
--- a/aspnetcore/fundamentals/index/samples/6.0/RazorPagesMovie/Migrations/RazorPagesMovieContextModelSnapshot.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-using System;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Metadata;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using RazorPagesMovie.Data;
-
-#nullable disable
-
-namespace RazorPagesMovie.Migrations
-{
- [DbContext(typeof(RazorPagesMovieContext))]
- partial class RazorPagesMovieContextModelSnapshot : ModelSnapshot
- {
- protected override void BuildModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "6.0.1")
- .HasAnnotation("Relational:MaxIdentifierLength", 128);
-
- SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
-
- modelBuilder.Entity("RazorPagesMovie.Models.Movie", b =>
- {
- b.Property("ID")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ID"), 1L, 1);
-
- b.Property("Genre")
- .IsRequired()
- .HasColumnType("nvarchar(max)");
-
- b.Property("Price")
- .HasColumnType("decimal(18,2)");
-
- b.Property("ReleaseDate")
- .HasColumnType("datetime2");
-
- b.Property("Title")
- .IsRequired()
- .HasColumnType("nvarchar(max)");
-
- b.HasKey("ID");
-
- b.ToTable("Movie");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/aspnetcore/fundamentals/index/samples/6.0/RazorPagesMovie/Models/Movie.cs b/aspnetcore/fundamentals/index/samples/6.0/RazorPagesMovie/Models/Movie.cs
deleted file mode 100644
index 9755050e75a5..000000000000
--- a/aspnetcore/fundamentals/index/samples/6.0/RazorPagesMovie/Models/Movie.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System.ComponentModel.DataAnnotations;
-
-namespace RazorPagesMovie.Models
-{
- public class Movie
- {
- public int ID { get; set; }
- public string Title { get; set; } = string.Empty;
-
- [DataType(DataType.Date)]
- public DateTime ReleaseDate { get; set; }
- public string Genre { get; set; } = string.Empty;
- public decimal Price { get; set; }
- }
-}
\ No newline at end of file
diff --git a/aspnetcore/fundamentals/index/samples/6.0/RazorPagesMovie/Pages/Error.cshtml b/aspnetcore/fundamentals/index/samples/6.0/RazorPagesMovie/Pages/Error.cshtml
deleted file mode 100644
index 6f92b9565570..000000000000
--- a/aspnetcore/fundamentals/index/samples/6.0/RazorPagesMovie/Pages/Error.cshtml
+++ /dev/null
@@ -1,26 +0,0 @@
-@page
-@model ErrorModel
-@{
- ViewData["Title"] = "Error";
-}
-
-
Error.
-
An error occurred while processing your request.
-
-@if (Model.ShowRequestId)
-{
-
- Request ID:@Model.RequestId
-
-}
-
-
Development Mode
-
- Swapping to the Development environment displays detailed information about the error that occurred.
-
-
- The Development environment shouldn't be enabled for deployed applications.
- It can result in displaying sensitive information from exceptions to end users.
- For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
- and restarting the app.
-