iklan

✔ The Type Initializer For 'Crystaldecisions.Crystalreports.Engine.Reportdocument' Threw An Exception

installShield.

Some error will be like
 An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object. The error is : The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception

 This lessons will show you how to fix some error in Crystal Report Applications Developme ✔ The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception

Solutions 1:

When a static constructor throws an exception, it is wrapped inside a TypeInitializationException. You need to check the exception object's InnerException property to see the actual exception.

In a staging / production environment (where you don't have Visual Studio installed), you'll need to either:
  1. Trace/Log the exception and its InnerException (recursively): Add an event handler to the AppDomain.UnhandledException event, and put your logging/tracing code there. Use System.Diagnostics.Debug.WriteLine for tracing, or a logger (log4net, ETW). DbgView (a Sysinternals tool) can be used to view the Debug.WriteLine trace.
  2. Use a production debugger (such as WinDbg or NTSD) to diagnose the exception.
  3. Use Visual Studio's Remote Debugging to diagnose the exception (enabling you to debug the code on the sasaran computer from your own development computer).

Solutions 2 :

If you are installing on a 64-bit machine, make sure the application properties under the Build tab have "Any CPU" as the platform target, and unselect the check box for "Prefer 32-bit" if you have the option. Crystal is very touchy about 32/64 bit assemblies, and makes some pretty counterintuitive assumptions which are very difficult to troubleshoot.

Solution 3 :

  1. i set x86 for my application, then i set x64 for my setup application
  2. Prerequisite: i Placed the supporting CR runtime file CRRuntime_32bit_13_0_10.msi, CRRuntime_64bit_13_0_10.msi in the following directory C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\Crystal Reports for .NET Framework 4.0
  3. Include merge module file to the setup project. Here is version is not serious thing because i use 13.0.10 soft, 13.0.16 merge module file File i included: CRRuntime_13_0_16.msm This file is found one among the set msm files.
While installing this Merge module will add the necessary dll in the following dir C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet

dll file version will not cause any issues.

In your developer machine you confirm it same.

List Video Tutorial VB.NET For beginners



List Video tutorials C# for Beginners



references :
http://stackoverflow.com/questions/16658300/the-type-initializer-for-crystaldecisions-crystalreports-engine-reportdocument

http://stackoverflow.com/questions/2866831/an-error-occurred-creating-the-form-see-exception-innerexception-for-details-t

See you next lessons .....
Sumber http://scqq.blogspot.com

Berlangganan update artikel terbaru via email:

0 Response to "✔ The Type Initializer For 'Crystaldecisions.Crystalreports.Engine.Reportdocument' Threw An Exception"

Posting Komentar

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel