diff --git a/docs/en/release-info/migration-guides/abp-10-0.md b/docs/en/release-info/migration-guides/abp-10-0.md index e7afdce02e..511488b911 100644 --- a/docs/en/release-info/migration-guides/abp-10-0.md +++ b/docs/en/release-info/migration-guides/abp-10-0.md @@ -10,7 +10,27 @@ We've upgraded ABP to .NET 10.0, so you need to move your solutions to .NET 10.0 ### Razor Runtime Compilation Obsolete -We removed the Razor Runtime Compilation support. +We removed the Razor Runtime Compilation support since it is obsolete and replaced by [Hot Reload](https://learn.microsoft.com/en-us/aspnet/core/test/hot-reload) in .NET 10.0. + +If you want to keep using it, you can add [Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation](https://www.nuget.org/packages/Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation) package to your project and configure it manually. + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + if (context.Services.GetHostingEnvironment().IsDevelopment()) + { + var mvcCoreBuilder = context.Services.AddMvc(); + mvcCoreBuilder.AddRazorRuntimeCompilation().Services +#pragma warning disable ASPDEPR003 + .Configure(options => +#pragma warning restore ASPDEPR003 + { + options.FileProviders.Add(new RazorViewEngineVirtualFileProvider(mvcCoreBuilder.Services + .GetSingletonInstance>())); + }); + } +} +``` For more information, you can check the [Razor Runtime Compilation Obsolete](https://learn.microsoft.com/en-us/dotnet/core/compatibility/aspnet-core/10/razor-runtime-compilation-obsolete) page.