Click here to Skip to main content
15,355,944 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have developed on application using C# language in visual studio 2019.

I have used crystal report in my app.

now when i am deploying on another system it is giving
The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exception

error when trying to open the form which has crystal report.


I am getting following error when deploying app on another pc.

Error Message
[^]



File system view when creating setup


https://i.imgur.com/EJKD8f8.png[^]

What I have tried:

try different version of crystal report and log4net dll.
Posted
Updated 13-Apr-22 0:26am

1 solution

I am aware this question was asked a long time ago, so if you've found a solution just ignore this.

Sometimes, this happens when:

a) The machine where you're installing the app does not have the correct Crystal Reports runtime or C++ Redistributable version installed. For example, when you have installed a 32-bit package on a 64-bit machine.
b) The application is compiled for a different CPU than the target CPU - for example, if the target machine is 32-bit but yours is 64-bit, you're going to need to switch the target CPU to x86 for the app that you install on the target machine. You can fix this by building the application and simply swapping the executable on the targer machine with the new one - no need to reinstall.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900