C# 尝试加载 Crystal Reports 运行时发生错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19286630/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-10 14:38:09  来源:igfitidea点击:

An Error Has Occured while attempting to load the Crystal Reports runtime

c#asp.net.netcrystal-reportswindows-server-2008-r2

提问by zack_falcon

I've been working on an internal website for quite some time now, maintaining it for a client. Other than a few bugs, the website is working as intended.

我已经在内部网站上工作了一段时间,为客户维护它。除了一些错误外,该网站按预期运行。

But then, all of a sudden, the error in question appears. This has never happened before.

但是,突然之间,出现了有问题的错误。这是以前从未发生过的。

Here are the software we used:

以下是我们使用的软件:

  • Windows Server 2008 R2, 64bit
  • Visual Studio 2005 as the IDE of choice
  • ASP.net / C# for the website
  • .NET 2.0
  • IIS, for the website hosting.
  • CrystalReport10, it would appear (from the picture).
  • Windows Server 2008 R2,64 位
  • Visual Studio 2005 作为首选 IDE
  • 网站的 ASP.net / C#
  • .NET 2.0
  • IIS,用于网站托管。
  • CrystalReport10,它会出现(从图片)。

Now, I have done some research on this, and a lot of people suggest re-building / publishing the website as x86instead of any CPU, and a lot of people also suggest re-installing 64-bit CR, etc., etc.

现在,我对此做了一些研究,很多人建议将网站重新构建/发布为x86而不是任何 CPU,而且很多人还建议重新安装 64 位 CR 等,等等。

But again, this has never happened before, and very few people actually tamper with the server. I see no reason why the website, which has been built using 'Mixed Platforms' since long before my time, would suddenly cease operating on the OS it was deployed to, also long before my time. As no one else uses that server, how could it suddenly generate such an error? It's not like someone can just go in there and uninstall stuff - Windows Update, maybe?

但同样,这以前从未发生过,很少有人真正篡改服务器。我看不出为什么这个早在我之前就使用“混合平台”构建的网站会突然停止在它部署的操作系统上运行,也早在我的时代之前。由于没有其他人使用该服务器,它怎么会突然产生这样的错误?不像有人可以进入那里卸载东西 - Windows Update,也许吧?

Here's a screenshot of what I found on the OS in C:\Windows\Assembly:

这是我在 C:\Windows\Assembly 中的操作系统上找到的截图:

Windows Server 2008

视窗服务器 2008

Strange thing is, I found the same thing on my local test dev PC, with the addition of some version 13 parts for another program I'm working on. The website works fine on my local test dev. On the live server, it does not. Before I assume that perhaps I have something necessary that the server does not, I also made myself remember that whatever was on the live server has been there for awhile - and the error only started happening now.

奇怪的是,我在我的本地测试开发 PC 上发现了同样的事情,并为我正在开发的另一个程序添加了一些版本 13 部分。该网站在我的本地测试开发人员上运行良好。在实时服务器上,它没有。在我假设我可能有一些服务器没有的必要东西之前,我还让自己记住,实时服务器上的任何内容已经存在一段时间了 - 并且错误现在才开始发生。

And here's the error in full:

这是完整的错误:

Server Error in '/' Application.

An error has occurred while attempting to load the Crystal Reports runtime.

Either the Crystal Reports registry key permissions are insufficient or the Crystal Reports runtime is not installed correctly.

Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required. Please go to http://www.businessobjects.com/supportfor more information. 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.

Exception Details: CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: An error has occurred while attempting to load the Crystal Reports runtime.

Either the Crystal Reports registry key permissions are insufficient or the Crystal Reports runtime is not installed correctly.

Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required. Please go to http://www.businessobjects.com/supportfor more information.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[LoadSaveReportException: An error has occurred while attempting to load the Crystal Reports runtime.

Either the Crystal Reports registry key permissions are insufficient or the Crystal Reports runtime is not installed correctly.

Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required. Please go to http://www.businessobjects.com/supportfor more information.]
CrystalDecisions.CrystalReports.Engine.ReportDocument.CheckForCrystalReportsRuntime() +379 CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor() +248

[TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception.]
CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor() +0
pages_reports_ApplicationHistoryRpt.GenerateReport() +163
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981

-------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.5448; ASP.NET Version:2.0.50727.5420

“/”应用程序中的服务器错误。

尝试加载 Crystal Reports 运行时发生错误。

Crystal Reports 注册表项权限不足或 Crystal Reports 运行时安装不正确。

请安装适当的 Crystal Reports 可再发行组件 (CRRedist*.msi),其中包含所需的 Crystal Reports 运行时(x86、x64 或 Itanium)的正确版本。请访问 http://www.businessobjects.com/support了解更多信息。说明:在执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。

异常详细信息:CrystalDecisions.CrystalReports.Engine.LoadSaveReportException:尝试加载 Crystal Reports 运行时发生错误。

Crystal Reports 注册表项权限不足或 Crystal Reports 运行时安装不正确。

请安装适当的 Crystal Reports 可再发行组件 (CRRedist*.msi),其中包含所需的 Crystal Reports 运行时(x86、x64 或 Itanium)的正确版本。请访问 http://www.businessobjects.com/support了解更多信息。

源错误:

执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常来源和位置的信息。

堆栈跟踪:

[LoadSaveReportException: 尝试加载 Crystal Reports 运行时发生错误。

Crystal Reports 注册表项权限不足或 Crystal Reports 运行时安装不正确。

请安装适当的 Crystal Reports 可再发行组件 (CRRedist*.msi),其中包含所需的 Crystal Reports 运行时(x86、x64 或 Itanium)的正确版本。请访问 http://www.businessobjects.com/support了解更多信息。]
CrystalDecisions.CrystalReports.Engine.ReportDocument.CheckForCrystalReportsRuntime() +379 CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor() +248

[TypeInitializationException: 'CrystalDecisions.CrystalReports.Engine.ReportDocument' 的类型初始值设定项引发异常。]
CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor() +0
pages_reports_ApplicationHistoryRpt.GenerateReport() +163
System.Web.UI.WebControls. Button.OnClick(EventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
System.Web.UI。 Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981

-------------------------------------------------- ------------------------------ 版本信息:Microsoft .NET Framework 版本:2.0.50727.5448;ASP.NET 版本:2.0.50727.5420

I hope someone can help me with this.

我希望有人能帮我解决这个问题。

Thanks.

谢谢。

回答by J R B

If you deploy your app in x86 mode will work proper. i have already faced this issue.

如果您在 x86 模式下部署您的应用程序将正常工作。我已经遇到过这个问题。

also should have .NET framework instead of .NET Client Framework.

还应该有 .NET 框架而不是 .NET Client Framework。

回答by Emanuele Greco

I suggest:

我建议:

Good luck!

祝你好运!

回答by Ally

Have you tried going into IIS and setting "Enable 32-Bit Applications" to "True" in the Advanced Settings of the application pool that the web site is running under?

您是否尝试进入 IIS 并在网站运行所在的应用程序池的高级设置中将“启用 32 位应用程序”设置为“真”?

I have to do this for the Crystal Reports 2008 (12.0.2000.0) version that I reference in my web application as the Crystal runtimes themselves are only 32 bit.

我必须为我在 Web 应用程序中引用的 Crystal Reports 2008 (12.0.2000.0) 版本执行此操作,因为 Crystal 运行时本身只有 32 位。

回答by Ralph Hightower

I encountered the same error when migrating a C# .Net web application from Windows 2003 to 2012.

我在将 C# .Net Web 应用程序从 Windows 2003 迁移到 2012 时遇到了同样的错误。

Check to see if the system has Adobe Reader installed. After the Adobe Reader was installed, the web application started displaying the reports.

检查系统是否安装了 Adob​​e Reader。安装 Adob​​e Reader 后,Web 应用程序开始显示报告。