Skip to content
Draft
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
7 changes: 4 additions & 3 deletions aspnetcore/mvc/views/view-compilation.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
title: Razor file compilation in ASP.NET Core
ai-usage: ai-assisted
author: tdykstra
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: 03/20/2023
ms.date: 01/30/2026
uid: mvc/views/view-compilation
---
# Razor file compilation in ASP.NET Core
Expand All @@ -20,7 +21,7 @@ Razor files with a `.cshtml` extension are compiled at both build and publish ti
> * 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).
> * Is recommended for development, not for production.
> * Is obsolete in .NET 10. For development scenarios, prefer [.NET Hot Reload](xref:test/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 @@ -29,7 +30,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]
> When enabled, runtime compilation disables [.NET Hot Reload](xref:test/hot-reload). We recommend using Hot Reload instead of Razor runtime compilation during development.
> When enabled, runtime compilation disables [.NET Hot Reload](xref:test/hot-reload). Razor runtime compilation is obsolete in .NET 10. 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

Expand Down