我们已经使用 Visual Studio 2010 用 .NET 3.5 编写了WPF应用程序。该解决方案包含8个项目-所有项目均在 .NET 3.5 中编译。该应用程序使用Crystal Report。目标操作系统是Windows 7。
We've a WPF application written in .NET 3.5 using Visual Studio 2010. The solution consists of 8 projects - all compiled in .NET 3.5. The application uses Crystal Report. Target OS is Windows 7.
最近,由于某些原因,启动项目在 .NET 4.0 中进行了编译。第三方DLL依赖关系-这些DLL需要.NET 4.0。更改并重建解决方案后,Crystal Report引发异常。
Recently, the startup project is compiled in .NET 4.0 due to some 3rd party DLL dependency - those DLLs require .NET 4.0. After this change and rebuilding the solution, Crystal Report is throwing exception.
问题出现在 ReportClass 的构造函数中
The problem occurs at the constructor of ReportClass.
异常的消息:
的类型初始值设定项' CrystalDecisions.CrystalReports.Engine.ReportDocument'抛出异常。
The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception.
InnerException消息:
InnerException's message:
使用具有CLSID 的组件检索COM类工厂{4DB2E2BB-78E6-4AEA-BEFB-FDAAB610FD1B}由于以下错误而失败: 80040154未注册类(HRESULT的异常: 0x80040154(REGDB_E_CLASSNOTREG))。
"Retrieving the COM class factory for component with CLSID {4DB2E2BB-78E6-4AEA-BEFB-FDAAB610FD1B} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))."
我没有在Crystal工作报告之前。
I haven't worked in Crystal Report before. What could be the cause of this problem?
请注意,编译为.NET 3.5时不会发生此问题。在启动项目中使用了Crystal Report。
Please note that this problem doesn't occur when compiled as .NET 3.5. Crystal Report is used in the startup project.
推荐答案可能是X86 / x64问题。
It is likely to be X86/x64 problem.
尝试将您的应用编译为目标86平台。
try to compile your app to target 86 platform.
更多推荐
.NET Framework 4.0中的Crystal Report
发布评论