'The type initializer for "Crystaldecisions.crystalreports.engine.reportdocument" threw an exception
I have been developing Crystal Reports for a while now and the software application is running perfect but got this error again the type initializer for "crystaldecisions.crystalreports.engine.reportdocument" threw an exception. Usually this error is fixed by the following methods:-
- Re-installing crystal report x86,x64 irrespective of system is 32 or 64bit.
- Changing target of the software application to "Any CPU" or "x86"
- Installing the missing Microsoft Visual C++ 2008 and 2010 (x86,64)
but this time even after doing so this error feels like sticking close to me. I even tried a method that wont work that is Enable 32-Bit Application in iis but still no success.
Can anyone point me what have i missed here?
Note:- This PC (x64 operating system) doesn't have Visual Studio 2008 installed and cannot be installed as this is a client's PC (not owned by me).
Solution 1:[1]
This error can be caused by a mismatch in Crystal Reports versions.
I got this error on the server where my ASP.NET MVC application is hosted. Crystal Reports 2008 was installed on my server machine, whereas my development machine was using the latest version of Crystal Reports.
Solution 2:[2]
If CrystalReportViewer control is used, the application must be have target CPU as x86.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Cody Gray |
Solution 2 | Alexander |