This is a self hosted project. There is a Views\Member.cshtml
file that is set to copy always as content. The following when run returns null for the razorView
. I seem to be missing something here.
var razorView = razor.GetViewPage("Member"); //e.g. /Views/Member.cshtml
var html = razor.RenderToHtml(razorView, em);
Console.WriteLine(html);
Furthermore I've tried this and it returns file not found
although the file is there:
var html = razor.RenderToHtml(AppDomain.CurrentDomain.BaseDirectory +
"Views\\" + "Member.cshtml", em);
Also, is there a way to have a service gateway return the rendered razor?
Member.cshtml
exists: https://db.tt/xuOSAjEj31
razor
: https://db.tt/qeApkAEZGH
AppHost.cs
:
Plugins.Add(new RazorFormat() {
// ScanRootPath = AppDomain.CurrentDomain.BaseDirectory + "Views"
} );