• Register
0 votes

Problem :

I am trying to deploy a desktop application to my clients that uses a Crystal Reports API to display and print the forms. I am building the installer using the InstallShield 2012. I have also included a .NET 4.0 Framework along with all of my Crystal assemblies.

But whenever I tried to run my application on my client machine, I face the blow error:

The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception.

I have really no idea what I am forgetting here. My CrystalDecisions.CrystalReports.Engine dll is being registered in a GAC correctly, as are about the 10 other Crystal assemblies.

3.9k points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

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

In the staging or production environment (where you don't have the Visual Studio installed), You will need to either of the below things:

1. Trace or Log a exception and its InnerException (recursively): Add the event handler to your AppDomain.UnhandledException event, and put the logging or tracing code there. Use the System.Diagnostics.Debug.WriteLine for tracing purpose, or the logger (log4net, ETW). DbgView (the Sysinternals tool) can be used to view your Debug.WriteLine trace.

2. Use the production debugger (such as the WinDbg or NTSD) to diagnose your exception.

3. Use the Visual Studio's Remote Debugging to diagnose your exception.

38.6k points

Related questions

0 votes
1 answer 17 views
Problem: The style initializer for 'crystal decisions.crystal reports.engine.report document threw an exception, and I need help to solve it.
asked Apr 17 padma1 34.8k points
0 votes
1 answer 20 views
Problem: I need assistance from others. crystal judgments The reportdocument in the Crystal Reports engine threw an exception.
asked Apr 17 padma1 34.8k points
0 votes
1 answer 7 views
Problem: Is there anyone who knows the answer:Could not load file or assembly crystal decisions crystal reports engine?
asked Jun 17 Nahil 122k points
0 votes
1 answer 6 views
Problem: Need to facilitate with this : The type initializer for 'awesomium.core.webcore' threw an exception.
asked Jun 18 nila 117k points
0 votes
1 answer 17 views
Problem: The following is my Windows service code. When I am debugging the code, I am getting the error/ exception: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Linq; using System.ServiceProcess ... if (isenable == true) { new_thread = new Thread(new ThreadStart(CheckForAlarms)); new_thread.Start(); } } } } }
asked May 29 Arwyn Martin 1.7k points
0 votes
1 answer 24 views
Problem: I have no idea how to solve this, someone help : The type initializer for module threw an exception
asked May 22 Chi Omega 166k points
0 votes
1 answer 36 views
Problem: When I display System.Net.Http properties in solution it has : An exception threw by the type initializer for 'system.web.http.globalconfiguration'
asked Apr 26 ochena 23.3k points
0 votes
1 answer 40 views
Problem: When starting this app, there are two logs, for v4.0.0.0 and v. Is this an issue?
asked Apr 26 ochena 23.3k points
0 votes
1 answer 58 views
Problem: I have a WCF application and some clients in my solution. What is the problem - when i try to access any method implemented in service from client, i get this error. I correctly added service references to every client and my Web.config ... false before deployment to avoid disclosing web app folder information. --> <directoryBrowse enabled="true"/> </system.webServer> </configuration>
asked Apr 26 sumaiya simi 43.9k points