【发布时间】:2016-05-02 19:29:16
【问题描述】:
我知道这个话题已经在几篇文章中讨论过,但没有一个解决方案能帮助我。
我有这个动作:
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,并且一切都在我的计算机上按预期工作。
在服务器上部署项目后,此操作不起作用,正在返回错误:
在执行过程中产生了一个未处理的异常 当前的网络请求。有关原产地和位置的信息 可以使用异常堆栈跟踪来识别异常 下面。
我正在使用 Visual Studio Community 2015。
在服务器上,我有Rotativa.dll 以及根目录中名为Rotativa 的文件夹,其中的文件名为wkhtmltopdf.exe。
我不知道如何处理这个错误,你能给我一些建议吗?
【问题讨论】:
标签: c# asp.net-mvc pdf-generation rotativa