具有 crystal 报告的 .Net 应用程序无法在共享主机中运行
.Net application with crystal report not working in shared hosting
我有一个使用 crystal 报告的 MVC 应用程序。我已使用以下代码下载报告,
ReportDocument rd = new ReportDocument();
rd.Load(Path.Combine(Server.MapPath("~/Reports/" + Session["rpt"])));
rd.SetDataSource(Session["result"]);
Response.Buffer = false;
Response.ClearContent();
Response.ClearHeaders();
//Excel
Stream stream = rd.ExportToStream(CrystalDecisions.Shared.ExportFormatType.Excel);
stream.Seek(0, SeekOrigin.Begin);
return File(stream, "application/vnd.ms-excel", "Cheque.xls");
报告在本地主机上下载工作正常。但是当我在 Godaddy 的共享主机中托管这个应用程序时,会出现以下屏幕
您收到此错误是因为 log4net 程序集版本不匹配。看到这个
link
Godaddy 的共享主机不支持 Crystal 报告。
不仅是Godaddy的共享主机,大部分主机商的共享主机也不支持
Crystal 报道。要使用 Crystal 报告,您必须购买 VPS 或专用服务器。
如果您想运行 Crystal 在服务器上报告,总是需要Crystal 在该服务器上报告运行时间。
GoDaddy 的共享主机服务器使用默认的中等信任级别,不支持
安装 Crystal 报告 运行 时间。
有用信息:
GoDaddy's shared hosting servers use the default Medium
trust level with the addition of OleDbPermission, OdbcPermission, and
a less-restrictive WebPermission.
Applications operating under a
Medium trust level have no registry access, no access to the Windows
event log, and cannot use reflection. Such applications can
communicate only with a defined range of network addresses and file
system access is limited to the application's virtual directory
hierarchy. Please make sure that your application can work in a
Medium trust environment if you are having any problems with it.
所以人们可以将其用作共享托管权限的一般指示。
支持 Crystal 报告的共享主机之一是 http://asphostportal.com。我不确定这一点。
我从其他社区获得了这些信息。
我已经与 Godaddy 共享主机双重确认了这一点,他们仅支持 Crystal 专用服务器或 VPS 截至 2021 年 4 月的报告。
我有一个使用 crystal 报告的 MVC 应用程序。我已使用以下代码下载报告,
ReportDocument rd = new ReportDocument();
rd.Load(Path.Combine(Server.MapPath("~/Reports/" + Session["rpt"])));
rd.SetDataSource(Session["result"]);
Response.Buffer = false;
Response.ClearContent();
Response.ClearHeaders();
//Excel
Stream stream = rd.ExportToStream(CrystalDecisions.Shared.ExportFormatType.Excel);
stream.Seek(0, SeekOrigin.Begin);
return File(stream, "application/vnd.ms-excel", "Cheque.xls");
报告在本地主机上下载工作正常。但是当我在 Godaddy 的共享主机中托管这个应用程序时,会出现以下屏幕
您收到此错误是因为 log4net 程序集版本不匹配。看到这个 link
Godaddy 的共享主机不支持 Crystal 报告。 不仅是Godaddy的共享主机,大部分主机商的共享主机也不支持 Crystal 报道。要使用 Crystal 报告,您必须购买 VPS 或专用服务器。
如果您想运行 Crystal 在服务器上报告,总是需要Crystal 在该服务器上报告运行时间。 GoDaddy 的共享主机服务器使用默认的中等信任级别,不支持 安装 Crystal 报告 运行 时间。
有用信息:
GoDaddy's shared hosting servers use the default Medium trust level with the addition of OleDbPermission, OdbcPermission, and a less-restrictive WebPermission.
Applications operating under a Medium trust level have no registry access, no access to the Windows event log, and cannot use reflection. Such applications can communicate only with a defined range of network addresses and file system access is limited to the application's virtual directory hierarchy. Please make sure that your application can work in a Medium trust environment if you are having any problems with it.
所以人们可以将其用作共享托管权限的一般指示。
支持 Crystal 报告的共享主机之一是 http://asphostportal.com。我不确定这一点。 我从其他社区获得了这些信息。
我已经与 Godaddy 共享主机双重确认了这一点,他们仅支持 Crystal 专用服务器或 VPS 截至 2021 年 4 月的报告。