我知道这个话题已经在几篇文章中讨论过,但没有一个解决方案对我有帮助。
我有这个动作:
public ActionResult DownloadViewPDF(string userId)
{
var model = db.MyCvs.FirstOrDefault(u => u.UserId == userId);
if (model != null)
return new Rotativa.ViewAsPdf("ViewUserCv", model) { FileName = model.FirstName + model.LastName + "_CV.pdf" };
return Content("there is no Cv to download");
}
使用上述操作,我正在将视图下载为 pdf,并且一切都在我的计算机上按预期工作。
在服务器上部署项目后,此操作不起作用,返回错误:
在执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常起源和位置的信息。
我正在使用 Visual Studio Community 2015。在服务器上,我有一个Rotativa.dll
名为 Rotativa 的根目录中的文件夹,其中的文件名为wkhtmltopdf.exe
.
我不知道如何处理这个错误,你能给我一些建议吗?