I\'ve created a new MVC6 project and building a new site. The goal is to get the rendered result of a view. I found the following code, but I can\'t get it to work because I
The solution provided by Martin Tomes worked for me but I had to replace:
ViewEngineResult viewResult = engine.FindView(ControllerContext, viewName, false);
with
ViewEngineResult viewResult = engine.GetView(_env.WebRootPath, viewName, false);
Also in controller constructor had to add
private IHostingEnvironment _env;
public AccountController(IHostingEnvironment env)
{
_env = env;
}