From 0c5ad468d5aa9d42c43d0c593551f693a8c868dc Mon Sep 17 00:00:00 2001 From: Tom Dykstra Date: Fri, 6 Feb 2026 09:13:36 -0800 Subject: [PATCH] Update view-compilation.md with runtime compilation details (#36749) * Update view-compilation.md with runtime compilation details Clarified the obsolescence of runtime compilation in .NET 10 and its limitations for Razor components and production use. * Update runtime compilation notes in view-compilation.md Clarify the obsolescence and limitations of runtime compilation. * Update notes on Razor runtime compilation in .NET 10 Clarified notes on Razor runtime compilation obsolescence and recommendations for production and development scenarios. * Update aspnetcore/mvc/views/view-compilation.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix formatting in view-compilation.md --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- aspnetcore/mvc/views/view-compilation.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/aspnetcore/mvc/views/view-compilation.md b/aspnetcore/mvc/views/view-compilation.md index 92922d06bda0..0ca3c20358b3 100644 --- a/aspnetcore/mvc/views/view-compilation.md +++ b/aspnetcore/mvc/views/view-compilation.md @@ -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 @@ -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 @@ -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). ## Enable runtime compilation for all environments