dotnet / dotnet/aspnetcore

Embedded Views in ASP.NET Core 10

Open
#64,715 2 comments 2 reactions 0 assignees View on GitHub
area-mvc
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

Previously, in .NET 9 and lower, we could use RazorRuntimeCompilation to implement embedded views in assemblies.

```
services.Configure( options =>
{
var embeddedFileProvider = new EmbeddedFileProvider( viewAssembly, baseNamespace );
options.FileProviders.Add( embeddedFileProvider );
} );

services.AddMvc().AddRazorRuntimeCompilation()
.AddApplicationPart( viewAssembly );
```

**However, in .NET 10**, Razor Runtime Compilation is obsolete. https://learn.microsoft.com/en-us/dotnet/core/compatibility/aspnet-core/10/razor-runtime-compilation-obsolete.

I am trying to upgrade my app to .NET 10, I am trying to find an alternative to RazorRuntimeCompilation that allows me to keep the same functionality, and am not finding a viable alternative.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.