• Register
0 votes
91 views

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.

7 5 2
3,870 points

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.

9 7 4
38,600 points

Related questions

0 votes
1 answer 18 views
18 views
Problem: I am currently working on developing the add in for the outlook 2010 with a Visual Studio Ultimate 2013. To create a setup package I am trying to use the InstallShield limited Edition. The setup has generated works on the 64 bit pc. It is not working ... 2010 Runtime The Visual studio 2010 Tools for the Office runtime I manually tried to remove any of the register on the 64 bit position.
asked Jul 6 Raphael Pacheco 4.9k points
0 votes
2 answers 244 views
244 views
Problem : Currently I am migrating from the Identity 1.0.0 to Identity 2.0.1. But the migrations code generated is nothing about the new IdentityUser. And It does not even add the new columns. So I tried to make the new project and also I ... current context At below line IdentityResult result = await UserManager.CreateAsync(user, model.Password); Any clue about the solution on my above problem?
asked Dec 25, 2019 alecxe 7.5k points
0 votes
1 answer 213 views
213 views
Problem : I am getting into the C# coding but I am having following issue: I have below code on the UserControl: using MyFirstDataLayer.Section1; public class MyFirstClass { protected void MyFirstMethod { MyFirstClass.MyFirstItem oItem = new MyFirstClass.MyFirstItem(); oItem = ... name instead I am not sure of what this actually means, I did some research but was unable to figure it out.
asked Dec 18, 2019 alecxe 7.5k points
0 votes
1 answer 15 views
15 views
How can you find the mime type of a file based on the file signature, not the extension in .Net? I want a simple way to get a mime type where the file extension is incorrect or not given, something similar?
asked Aug 29 Aliza313 720 points