Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking changes to runtime compilation for Razor views and Razor Pages #343

pranavkm opened this issue Feb 16, 2019 · 0 comments

Breaking changes to runtime compilation for Razor views and Razor Pages #343

pranavkm opened this issue Feb 16, 2019 · 0 comments


Copy link

@pranavkm pranavkm commented Feb 16, 2019

As a consequence of cleaning up the ASP.NET Core shared framework to not depend on Roslyn, support for runtime compilation of Razor views and Razor Pages is being moved to a separate package.
Applications that require runtime compilation or re-compilation of Razor files should

  • Add a reference to the Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation package
  • Update the application's ConfigureServices to include a call to AddMvcRazorRuntimeCompilation:

The following APIs previously available on Microsoft.AspNetCore.Mvc.Razor.RazorViewEngineOptions to support runtime compilation would now be available via

  • RazorViewEngineOptions.FileProviders -> MvcRazorRuntimeCompilationOptions.FileProviders
  • RazorViewEngineOptions.AdditionalCompilationReferences -> MvcRazorRuntimeCompilationOptions.AdditionalReferencePaths

In addition, Microsoft.AspNetCore.Mvc.Razor.RazorViewEngineOptions.AllowRecompilingViewsOnFileChange has been removed. Recompilation on file changes is enabled by default by referencing the Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation package.

Related issues: #312, #325

Please use dotnet/aspnetcore#7647 for further discussions or questions.

This announcement has been migrated to dotnet/docs#14925

@pranavkm pranavkm added this to the 3.0.0 milestone Feb 16, 2019
@aspnet aspnet locked as spam and limited conversation to collaborators Feb 16, 2019
rafa-ce referenced this issue in rafa-ce/AutomobileServiceCenter.Core Apr 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants