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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ms.date: 08/08/2025

# Razor run-time compilation is obsolete

Razor run-time compilation is obsolete and is not recommended for production scenarios. For production scenarios, use the default build-time compilation. For development scenarios, use Hot Reload instead.
Razor run-time compilation is obsolete and is not recommended for production scenarios. For production scenarios, use the default build-time compilation. For development scenarios, use [Hot Reload](/aspnet/core/test/hot-reload) instead.

## Version introduced

Expand All @@ -28,11 +28,11 @@ This change can affect [source compatibility](../../categories.md#source-compati

## Reason for change

Razor run-time compilation has been replaced by Hot Reload, which has been the recommended approach for a few years now. This change makes it clearer that Razor run-time compilation doesn't get support for new features and should no longer be used.
Razor run-time compilation has been replaced by [Hot Reload](/aspnet/core/test/hot-reload), which has been the recommended approach for a few years now. This change makes it clearer that Razor run-time compilation doesn't get support for new features and should no longer be used.

## Recommended action

Remove calls to <xref:Microsoft.Extensions.DependencyInjection.RazorRuntimeCompilationMvcBuilderExtensions.AddRazorRuntimeCompilation%2A> and use Hot Reload instead.
Remove calls to <xref:Microsoft.Extensions.DependencyInjection.RazorRuntimeCompilationMvcBuilderExtensions.AddRazorRuntimeCompilation%2A> and use [Hot Reload](/aspnet/core/test/hot-reload) instead.

## Affected APIs

Expand All @@ -41,3 +41,7 @@ Remove calls to <xref:Microsoft.Extensions.DependencyInjection.RazorRuntimeCompi
- <xref:Microsoft.Extensions.DependencyInjection.RazorRuntimeCompilationMvcCoreBuilderExtensions.AddRazorRuntimeCompilation%2A?displayProperty=fullName>
- <xref:Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.FileProviderRazorProjectItem?displayProperty=fullName>
- <xref:Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.MvcRazorRuntimeCompilationOptions?displayProperty=fullName>

## See also

- [.NET Hot Reload support for ASP.NET Core](/aspnet/core/test/hot-reload)
Loading