报表可在开发PC上运行,但会在其部署的PC上引发异常(CrystalDecisions.CrystalReports.Engine.ReportDocument) [英] Report works on development PC but throws exception on the PC where it's deployed (CrystalDecisions.CrystalReports.Engine.ReportDocument)

查看:135
本文介绍了报表可在开发PC上运行,但会在其部署的PC上引发异常(CrystalDecisions.CrystalReports.Engine.ReportDocument)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用Crystal Reports开发了一个应用程序,当我在开发PC上测试该项目可以运行时,但在客户PC上却出现了异常



'CrystalDecisions.CrystalReports.Engine.ReportDocument'的类型初始值设定项引发
异常。


该项目也是使用VS 2010开发的,然后在VS 2008中完成,所以我现在正在使用VS 2008进行开发,我不确定这是否会引起问题,并且关于设置项目,我引用了以下DLL:

  -CrystalDecisions.CrystalReports.Engine.dll 
-CrystalDecisions.ReportSource.dll
-CrystalDecisions.Shared.dll
-CrystalDecisions.Web.dll
-CrystalDecisions.Windows.Forms.dll

所有DLL都具有相同的版本号:10.2.3600.0



然后我安装安装程序而不安装其他任何东西,然后.net Fram ework 3.5,(我必须安装运行时Crystal Report引擎吗?是否必须安装哪个版本? )。



异常详细信息:


System.TypeInitializationException:类型初始化器
'CrystalDecisions.CrystalReports.Engine.ReportDocument'引发
异常。 ---> System.IO.FileNotFoundException:无法加载文件
或程序集'CrystalDecisions.ReportAppServer.CommLayer,
Version = 10.2.3600.0,Culture = neutral,PublicKeyToken = 692fbea5521e1304'
或它的依赖项之一。该系统找不到指定的文件。
文件名:'CrystalDecisions.ReportAppServer.CommLayer,
版本= 1.0.2.3600.0,Culture = neutral,PublicKeyToken = 692fbea5521e1304'
在CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor()



WRN:程序集绑定日志记录已关闭。要启用程序集绑定
故障日志记录,请将注册表值
[HKLM\Software\Microsoft\Fusion!EnableLog](DWORD)设置为1。注意:
会降低性能。与程序集绑定失败
日志记录相关联。要关闭此功能,请删除注册表值
[HKLM\Software\Microsoft\Fusion!EnableLog]。


首先感谢您的帮助。

解决方案

在客户端计算机上,您需要为您的版本安装Crystal Runtime。通常,如果您使用的是VS2008,则需要为.NET Framework安装Crystal Reports 2008运行时程序包(推荐),或将Crystal Reports 2008 Runtime的合并模块嵌入到自己的设置中(不推荐)。从此处: http://resources.businessobjects.com/support/additional_downloads/runtime。 asp#08
将在客户端上安装Crystal Report的程序集。



如果之后仍然存在问题,则需要验证Crystal。*。dll具有与安装在Windows上的版本相同的版本。客户端计算机。



如果要在这些程序集的属性上使用特定版本的Crystal程序集,请在VS内的属性中将特定版本更改为True

最后,检查是否缺少使程序集版本不同的Crystal SP / HotFix。
http://wiki.sdn.sap.com/wiki/ display / BOBJ / Crystal + Reports + 2008 +-+ Version + and + Download + information + for + SPs + and + FPs


I developed an application with Crystal Reports, when i test the project on the development PC it works, but it gives an exception on the customer PC

The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception.

also the project was developed Using VS 2010 then it completed with VS 2008,so I am developing using VS 2008 now, I'm not sure if this Could Cause the problem, and about the Setup Project i make a reference to the following DLLs:

-CrystalDecisions.CrystalReports.Engine.dll
-CrystalDecisions.ReportSource.dll
-CrystalDecisions.Shared.dll
-CrystalDecisions.Web.dll
-CrystalDecisions.Windows.Forms.dll

All DLLs have the same version number :10.2.3600.0

And i install the setup without installing anything else then .net Framework 3.5, (Do i have to install a runtime Crystal Report engine and if have to which version to install? ).

Exception Details:

System.TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'CrystalDecisions.ReportAppServer.CommLayer, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified. File name: 'CrystalDecisions.ReportAppServer.CommLayer, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' at CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor()

WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Thanks in advance for any Help.

解决方案

On the client's machine you need to install the Crystal Runtime for your version. Normally if you are using VS2008 you need to install Crystal Reports 2008 Runtime Package for the .NET Framework (recommended), or embed the Merge Modules for Crystal Reports 2008 Runtime into your own setup (not recommended). From here: http://resources.businessobjects.com/support/additional_downloads/runtime.asp#08 That will install Crystal Report's assemblies needed on the client. Have you done that already?

If after that you still have problems, you need to verify that the Crystal.*.dll has the same version than the ones installed on the client's machine.

If you want to use specific version of the crystal assemblies on the properties of those assemblies change the Specific Version to True in the Properties within VS

Finally, check if you are missing a Crystal SP/HotFix which makes the assemblies version differ http://wiki.sdn.sap.com/wiki/display/BOBJ/Crystal+Reports+2008+-+Version+and+Download+information+for+SPs+and+FPs

这篇关于报表可在开发PC上运行,但会在其部署的PC上引发异常(CrystalDecisions.CrystalReports.Engine.ReportDocument)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆