ASP.NET - Crystal report Throwing exception - Asked By Dilip Sharma on 29-Sep-11 06:39 AM

hi i am using visual studio 2010...

in my C# window application i am using crystal report...

but it giving the following exception

The type initializer for 'CrystalDecisions.ReportSource.ReportSourceFactory' threw an exception

on this line 

 private void InitializeComponent()
            this.crystalReportViewer1 = new CrystalDecisions.Windows.Forms.CrystalReportViewer();

Plse any one tell What is solution for that........

Web Star replied to Dilip Sharma on 29-Sep-11 06:43 AM

In one case these issues were solved when I went to

Solution Explorer -> right click project -> properties -> Build -> General -> Platform target -> x86

note it’s x86 even though i’m on a x64 box

Web Star replied to Dilip Sharma on 29-Sep-11 06:45 AM
If you set target platform to x86 you need the VS2010 Redist 32 bit an your machine. the Redist 64 is only for 64 bit processes. x86 mean 32 bit process.
also see this link
Suchit shah replied to Dilip Sharma on 29-Sep-11 06:49 AM

Make sure you are using the 4.0 Framework and not the 4.0 Client framework.

When you uninstalled the beta did you clean up the folders and registry entries. See this SAP post for more info on removing the beta:

It may also be realted to this post:

What database driver are you using? If it's adoplus then add this to your app.config file:

<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>

and also check r u missing any dll refrence or not
Reena Jain replied to Dilip Sharma on 29-Sep-11 06:57 AM

I faced this exception because of not installing Crystal Report component for Common Files. After reinstalling that particular component again it worked as it should work. However you can check for more solutions.

try this and let me know
Dilip Sharma replied to Reena Jain on 29-Sep-11 07:56 AM
yes. . its working .. i re installed  all  ..
Now working fine.......