Using Razor outside of ASP.NET

Now that MVC 3 seems to be officially released, we know if there is official support for using Razor outside the ASP.NET pipeline.

I know that there were several reports on how to do this, but no one seemed official, and everything was a little different.

If there is still no official way to do this, can someone point me to the best existing solution?

Thanks!

+4
source share
1 answer

It really depends on your definition of "official."

Yes, Razor was explicitly designed to work outside the ASP.NET pipeline.

No, there are no official APIs issued by the ASP.NET team that allow Razor to run outside of ASP.NET using only one line of code. There is some kind of configuration needed to work.

Andrew Nurse (who worked on Razor) wrote a blog post about what you need to create this feature yourself ( http://vibrantcode.com/blog/2010/11/16/hosting-razor-outside-of-aspnet-revised- for-mvc3-rc.html ).

I did not conduct an exhaustive search, but RazorEngine was the first project I know to build on top of Razor and provide such a simple API. I would advise you to start with this and see if it fits your needs.

+8
source

Source: https://habr.com/ru/post/1347260/


All Articles