SAP Knowledge Base Article - Public

1916344 - ERROR: "The type initializer for 'CrystalDecisions.ReportSource.ReportSourceFactory' threw an exception."

Symptom

While viewing a Crystal report in the Windows form viewer, following exception is thrown:
ERROR: "The type initializer for 'CrystalDecisions.ReportSource.ReportSourceFactory' threw an exception."

Environment

  • Visual Studio 2010
  • SAP Crystal Reports, developer version for Microsoft Visual Studio 2010

Cause

Target CPU (platform) property of the project is set to "ANY CPU".

Resolution

  1. Right click on the application name in the Solution Explorer.
  2. Click on Properties.
  3. Go to Compile option on the left side.
  4. Change the Target CPU property to "x86" or "x64" as per need.

NOTE: "ANY CPU" is not recommended for any Crystal reports .NET SDk applications.

Keywords

Crash, .net, .net sdk, Target platform, Platform CPU. , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , Problem

Product

SAP Crystal Reports, developer version for Microsoft Visual Studio