我在 VS2013 中有一个 winforms 应用程序
它运行 RDLC 报告和 Razor View 报告(从我们的网络应用程序中提取)
在我的 w7 盒子上,两种类型的报告都可以工作......
在服务器 2012 R2 RDLC 报告失败,深入 CLR,并给出以下错误:(但 Razor 视图 -> pdf via Rotativa 工作正常)
Problem signature:
Problem Event Name: APPCRASH
Application Name: EFRG3G.exe
Application Version: 3.1.16.0
Application Timestamp: 53dc0cb7
Fault Module Name: clr.dll
Fault Module Version: 4.0.30319.34014
Fault Module Timestamp: 52e0b86c
Exception Code: c0000005
Exception Offset: 0000000000003150
OS Version: 6.3.9600.2.0.0.400.8
Locale ID: 1033
Additional Information 1: 372e
Additional Information 2: 372ebc0e88d0905b1dfc62799213ffc9
附加信息 3:0f90 附加信息 4:0f90fe4c558cb8bf2158eb0f66bc20e2
如果我在远程调试器中运行它,我会得到更多信息:
Managed Debugging Assistant 'FatalExecutionEngineError' has detected a problem in '\\jcdc-d-web-003\d$\WinForm\EFRG3G\EFRG3G.exe'.
Additional information: The runtime has encountered a fatal error. The address of the error was at 0x95ab3150, on thread 0x42fc. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
当我尝试像这样呈现 RLDC 报告时,它就发生了:
LocalReport localViewer =
new LocalReport
{
EnableExternalImages = true,
ReportEmbeddedResource =
"EFRG3G.Reporting.RDLC." + reportRenderParameters.ReportFileName
};
localViewer.DataSources.Add(reportRenderParameters.ReportDataSource);
// add parameters that rdlc needs
if (reportRenderParameters.ReportParameters.Count != 0)
localViewer.SetParameters(reportRenderParameters.ReportParameters);
// setup subreports
if (reportRenderParameters.SubReportsDataSources.Count != 0)
{
foreach (ReportDataSource reportDataSource in reportRenderParameters.SubReportsDataSources)
{
localViewer.DataSources.Add(reportDataSource);
}
localViewer.SubreportProcessing += SetSubReportDataSource;
}
Byte[] byteArray = null;
byteArray = localViewer.Render( // it blows up right here!!!
reportRenderParameters.ReportType.ToString( "g" ), "",
out mimeType,
out encoding,
out fileExtension,
out streamids,
out warnings );
相同的代码适用于 vs2008、vs2010
我认为它是缺少报告 pre req,没有安装在 2102 服务器上,所以我安装了这个:
Microsoft.ReportViewer 2012
这需要安装这个:
Microsoft® SQL Server® 2012 的 Microsoft® System CLR 类型
但它仍然无法正常工作......
要在 Server 2012 R2 上查看 vs2013 编译的 RDLC,还需要什么?
如果不是缺少先决条件,还有什么可能仅在 Svr 2012 R2 上导致此错误?