The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception
Hi All,
I am getting error " The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception " while loading crystal reports in windows forms application . it is working fine in DEV environment and on some client machines no issues loading reports. But on some machines it is trowing error whole loading crystal report and then application crashes. This is happening with fresh installation on client machines(both 32-bit/64-bit) and application that is already running and which used to load crystal reports fine.Please kindly help.
I am using visual studio 2002 and Crystal reports 10
NA
Crystal Reports
Last Comment
Mike McCracken
8/22/2022 - Mon
Mike McCracken
How is the application compiled?
Is it for 32 bit/64 bit/Any CPU?
This link from MSDN indicates to target x86 (32-bit)
Crystal is a 32-bit application so you should compile for that.
thanks for your kind response. how do you check platform settings in VS 2002 . I know in 2005 you can check in project properties. I don't see that option in VS 2002.
NA.
Mike McCracken
I don't know. I am not a .net programmer.
If I recall correctly, VS2002 was probably 32-bit only so there may not be a setting for it.
I think VS2002 is for 32 bit only . application is not working on some 32 bit and some 64 bit machines.
mech engr
ASKER
I Could not find the registry value CLSID {CF76A644-314B-404D-8D45-F08B51FF990B} from the below error , this is common across all machine s that is throwing error . Is it licensing issue or am i missing some package to install? its related to Crystal reports version 10.0
System.TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. ---> System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {CF76A644-314B-404D-8D45-F08B51FF990B} failed due to the following error: 80040154.
at CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor()
Mike McCracken
Are you installing the CR 10 runtime files or msi?
Is it for 32 bit/64 bit/Any CPU?
This link from MSDN indicates to target x86 (32-bit)
Crystal is a 32-bit application so you should compile for that.
https://social.msdn.microsoft.com/Forums/es-ES/f134b4a6-b40a-4064-8ca7-3f3058c20965/the-type-initializer-for-crystaldecisionscrystalreportsenginereportdocument-threw-an-exception?forum=vscrystalreports
mlmcc