Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions aspnetcore/mvc/views/view-compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Learn how compilation of Razor files occurs in an ASP.NET Core app.
monikerRange: '>= aspnetcore-3.1'
ms.author: tdykstra
ms.custom: mvc
ms.date: 01/30/2026
ms.date: 02/06/2026
uid: mvc/views/view-compilation
---
# Razor file compilation in ASP.NET Core
Expand All @@ -16,7 +16,15 @@ uid: mvc/views/view-compilation
Razor files with a `.cshtml` extension are compiled at both build and publish time using the [Razor SDK](xref:razor-pages/sdk). Runtime compilation may be optionally enabled by configuring the project.

> [!NOTE]
> **Runtime compilation was obsoleted starting in .NET 10. For more information, see [Razor runtime compilation is obsolete](/dotnet/core/compatibility/aspnet-core/10/razor-runtime-compilation-obsolete).**
> Runtime compilation:
> * Was obsoleted starting in .NET 10.
> * Isn't supported for Razor components of Blazor apps.
> * Doesn't support [global using directives](/dotnet/csharp/whats-new/csharp-10#global-using-directives).
> * Doesn't support [implicit using directives](/dotnet/core/tutorials/top-level-templates#implicit-using-directives).
> * Disables [.NET Hot Reload](xref:test/hot-reload).
> * Isn't recommended for production scenarios.
>
> For production scenarios, use the default build-time compilation. For development scenarios, use Hot Reload. For more information, see [Razor runtime compilation is obsolete](/dotnet/core/compatibility/aspnet-core/10/razor-runtime-compilation-obsolete).

## Razor compilation

Expand All @@ -25,7 +33,7 @@ Build-time and publish-time compilation of Razor files is enabled by default by
Updating Razor views and Razor Pages during development while the app is running is also supported using [.NET Hot Reload](xref:test/hot-reload).

> [!NOTE]
> **Razor runtime compilation was obsoleted starting in .NET 10. When enabled, runtime compilation disables [.NET Hot Reload](xref:test/hot-reload). We recommend using Hot Reload instead for development scenarios. For more information, see [Razor runtime compilation is obsolete](/dotnet/core/compatibility/aspnet-core/10/razor-runtime-compilation-obsolete).**
> Razor runtime compilation was obsoleted starting in .NET 10. When enabled, runtime compilation disables [.NET Hot Reload](xref:test/hot-reload). We recommend using Hot Reload instead for development scenarios. For more information, see [Razor runtime compilation is obsolete](/dotnet/core/compatibility/aspnet-core/10/razor-runtime-compilation-obsolete).
Comment on lines 35 to +36
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are now two adjacent NOTE blocks that both state runtime compilation was obsoleted in .NET 10 and that it disables Hot Reload. Consider consolidating into a single NOTE (either keep the new detailed list and remove this one, or vice versa) to avoid redundant guidance and reduce the risk of the two notes drifting out of sync over time.

Copilot uses AI. Check for mistakes.

## Enable runtime compilation for all environments

Expand Down