部署后 PDF 创建功能崩溃

PDF creation function crashes after deployment

我有一种方法可以根据从模型中检索到的信息从视图中创建一个 pdf 文件。它在调试模式下在我的电脑上没有任何问题,但是在 IIS 服务器(不同的机器)上部署后它开始崩溃。 我已经通过装配授予地图上所有用户的完全访问权限,但没有帮助。 错误消息是无用的它只说 "something went wrong"

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

我的代码:

    [HttpPost]
    public ActionResult EmployeesForExamination(List<EmployeeListForHealthExamination> model)
    {
        List<EmployeeListForHealthExamination> listForPrint = new List<EmployeeListForHealthExamination>();
        foreach (var item in model)
        {
            if (item.printDoc)
            {
                return CreatePDF(item);
            }
        }
        return View(model);   
    }
    [AllowAnonymous]
    public ActionResult ReportForHE(EmployeeListForHealthExamination model)
    {
        using (var db = new HRMEntities())
        {
            model.harmingFactorList = db.EmployeeHarmingFactors.Where(e => e.EmployeeId == model.EmployeeId).ToList();
            return PartialView("Partial/_ReportHE", model);
        }
    }

    [AllowAnonymous]
    public ActionResult CreatePDF(EmployeeListForHealthExamination model)
    {
        return new ActionAsPdf("ReportForHE", model)
        {
            FileName = model.FirstName + model.LastName + "HealthExamination.pdf"
        };
    }

这个问题可能是因为你的服务器上没有旧版本visual c++的visual c++,请尝试升级。