Razor view compilation in standalone app for emails
Hello community.
I want to compile razor views in an standalone app that contains those views.
What I need to compile those views like when we're working with MVC to see if there's is any issue and prompt it (The use of MvcBuildViews to be more precise), to ensure there isn't any surprise on the email templates?
Regards.
Thanks for contacting us, @Ryujose. Can you please provide more details about your scenario? What version of SDK are you targeting? What is the project type? All the razor views in a ASP.NET Core web app project will be compiled during build (from 2.1 on) automatically.
Also see See https://github.com/aspnet/Entropy/tree/master/samples/Mvc.RenderViewToString and past discussions - https://github.com/aspnet/Mvc/issues/4884, https://github.com/aspnet/Razor/issues/2274
Sure! I'll detail it bellow.
Project type: Console App Platform: .NET Framework 4.5.2
Current project references:
- Microsoft.ApsNet.Razor v3.0.0
- RazorEngine v3.9.1
Thanks in advance!
@pranavkm the first link seems broken with 404 error (https://github.com/aspnet/Entropy/tree/dev/samples/Mvc.RenderViewToString).
Updated it
@Ryujose, it seems you're referencing some third party library (RazorEngine), which is nothing we support or are aware of. Unfortunately we won't be able to help you with this. Try the StackOverflow - as you may better community for this particular question in there.