soundaranbu/Razor.Templating.Core

Update Razor templates without recompiling?

Closed this issue · 4 comments

Thank you for this excellent library! I am using it in several projects.

Is there any way to update the underlying Razor templates and see those updates reflected in the string emitted by RazorTemplateEngine without restarting the application? It would speed up my development process immensely if I could edit the .cshtml files without restarting each time.

Hey @korggy, that's great to know!

I think we need to use Razor Runtime Compilation. You can try it and let me know.

I'll also check in the mean time.

Yes, that worked! Great, thank you. Might be worth mentioning in the README...

Sure I'll update the README. Also, please consider adding the code snippet here that you tried. It might help someone. Thanks :)

No code snippet required -- I simply added the Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation NuGet package to my project and it magically started working.