Using Razor Outside of Web
π‘
If you want to skip my mumbling and go straight to the coding part, jump to Let's start.
Razor is a markup syntax for creating dynamic web pages in C#. It has been a part of the ASP.NET MVC framework since early 2011 and is currently a part of A...
denace.dev7 min read
John Zabroski
Founder @ Simmaculate
It's worth noting that HtmlRenderer is a very heavyweight component and includes everything required to render Razor Components (Blazor Components). If you just need something simpler, you can use RazorSlices. It won't have tag helpers (and view components), but you may not need all that other stuff. For background, I used to be the maintainer of RazorLight, which was the most popular Razor renderer many years ago. I stopped support around .NET 6 as Microsoft was making it progressively more difficult to have Razor function standalone, and I was no longer actively doing web development.