-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templates
Milestone
Description
Background and Motivation
As raised in dotnet/aspnetcore#64338: Razor runtime compilation is being fully deprecated in .NET 10 with the intent to remove it in a future release. While some extension methods currently show the obsolete warning, others (e.g., AddRazorRuntimeCompilation with no arguments) do not, leading to confusion for end users.
Bug Details
- Only some overloads (those taking Action) display an obsolete warning due to the argument type being obsolete.
- Parameterless method overloads for AddRazorRuntimeCompilation do NOT display any warning.
- API users can unknowingly continue using obsolete runtime compilation APIs with no warning.
Solution Proposal
- Mark ALL overloads of AddRazorRuntimeCompilation and related extension methods with the ASPDEPR003 [Obsolete] attribute (not just on the parameter type or static class).
- Ensure every use of AddRazorRuntimeCompilation (parameterless or otherwise) triggers the intended obsolete warning in .NET 10 and future releases.
- Reference obsolete warning to Hot Reload as the recommended alternative for development workflows.
Code references
Relevant source files needing updates:
Example usage
mvcBuilder.AddRazorRuntimeCompilation(); // Should generate ASPDEPR003 obsolete warning
mvcBuilder.AddRazorRuntimeCompilation(options => {}); // Should generate ASPDEPR003 obsolete warningRisks
- Breaking change for developers using runtime compilation extension APIs for development
- Required migration pain for scenarios relying on runtime view loading (e.g. from a database, custom provider, or dynamic sources)
Related context
Metadata
Metadata
Assignees
Labels
area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templates