2

x86 で正しく動作するプログラムがあります。また、x64 でも Visual Studio のシステムでエラーなく動作します。ただし、Visual Studio を使用しない x64 システムでは、レポートの呼び出し時にエラーが発生します。メッセージの例外は:

The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception.
Source:
CrystalDecisions.CrystalReports.Engine
Stack Trace:
   at CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor()
   at CrystalDecisions.CrystalReports.Engine.ReportClass..ctor()

およびこの説明を含むメッセージ:

An error has occurred while attempting to load the Crystal Reports runtime.
Either the Crystal Reports registry key permissions are insufficient or the Crystal Reports runtime is not installed correctly.
Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required.  Please go to http://www.businessobjects.com/support for more information.

私のプログラムは以下に基づいています:

  • .net フレームワーク 4
  • ビジュアルスタジオ 2012
  • クリスタルレポート 13.0.2

CRRuntime_64bit_13_0_2 を時々インストールします。

誰でも私を助けることができますか?

4

1 に答える 1

1

1つの可能な解決策

アプリケーションプロジェクトに移動し、右クリックして[プロパティ]を選択します

[ビルド]タブで、[プラットフォームターゲット]コンボボックスを見つけます。おそらく「任意のCPU」と表示されます。

これをx86に変更すると、プロジェクトは32ビットのみでコンパイルされるため、問題が解消されます。

于 2012-10-23T12:42:37.520 に答える