• 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.

7 5 2
3,870 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.

9 7 4
38,600 points

Related questions

0 votes
1 answer 22 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, 2020 Raphael Pacheco 4.9k points
0 votes
2 answers 347 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 418 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 23 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, 2020 Aliza313 720 points
0 votes
1 answer 82 views
Problem : I am very new to ASP.Net. I have created my first ASP.Net application which impersonates the user in order to create the AD group, and after that it launches the powershell process as the user saperately. But because of some reason the group ... I would rather not compromise with the security policy with the server ideally, and this application will be used by around 100+ users.
asked Dec 5, 2019 alecxe 7.5k points
0 votes
1 answer 18 views
0 votes
1 answer 7 views
0 votes
1 answer 24 views
0 votes
1 answer 190 views
Problem: I am very new to .Net programming. Recently I was trying to run the .Net socket server code on my Win7-64bit machine. But I am receiving the below error: System.Net.Sockets.SocketException: An address incompatible with the requested protocol was used. Error Code: 10047 ... -XP sp3 . I have already checked the error code details on MSDN but it does not make any sense to a beginner like me.
asked Aug 22, 2020 Raphael Pacheco 4.9k points