Hi, thanks for response.
I'm new in all of this and I don't know how to debug a NuGet package. So I copied the method RenderViewToStringAsync to my controller and also change the view name
var contenido = await RenderViewToStringAsync1(HttpContext, RouteData, "~/Areas/Cajas/Views/Cobros/DetailsPrint.cshtml", cobroVM);
The RenderViewToStringAsync method gives me null on viewResult
var viewResult = ((IRazorViewEngine)context.RequestServices.GetService(typeof(IRazorViewEngine))).FindView(actionContext, viewName, false);
Doing some research on internet in found many people have problem with FindView Method so I comment the line and add replace it with GetView method
//var viewResult = ((IRazorViewEngine)context.RequestServices.GetService(typeof(IRazorViewEngine))).FindView(actionContext, viewName, false);
var hostingEnv = context.RequestServices.GetService(typeof(IHostingEnvironment)) as IHostingEnvironment;
var viewResult = ((IRazorViewEngine)context.RequestServices.GetService(typeof(IRazorViewEngine))).GetView(hostingEnv.WebRootPath, viewName, false);
and its works, but I don't know why FindView method give me null.
Any Suggestion?
Thanks!