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
- Right click on the application name in the Solution Explorer.
- Click on Properties.
- Go to Compile option on the left side.
- 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