I have an error condition explained below that I can prevent from happening by first opening an ArcMap dialog box before I run the code. I can open any Arcmap dialog "File Save...", customize>extensions... anything in the arcmap menus will prevent this error. Why?
I have references to the Crystal Reports 2008 components in an ArcGIS 10 desktop application. I have one line of VB code that runs from a simple desktop button:
Dim cReport as New CrystalDecisions.CrystalReports.Engine.ReportDocument
it produces the error:
The type initializer for "CrystalDecisions.CrystalReports.Engine.ReportDocument" Threw an exception
This also runs fine if I don't launch it from within ArcGIS. Does anyone have a clue what might be going on.
Hi there, did you have solution to your problem here? I have the same problem and waste almost a week trying the find a solution.
I am having the same issue (with an ArcEngine app)... If I try to access a crystal assembly/method (ie. CrystalDecisions.CrystalReports.Engine.ReportDocument.Load()), I get the "Type initializer error" when I try to launch the Engine app. Same thing vice versa (if I open the ArcEngine app first, I get the "Type initializer error" when I try to launch the crystal reports method.
Note: The exact same code works fine if the app is built against ArcGIS 9.3.1.