2012-10-23 62 views
2

我有一個程序,在x86上正常工作。即使在x64上,它也可以在沒有錯誤的Visual Studio系統上運行。但在沒有Visual Studio的x64系統上,當通話報告發生錯誤時。消息的例外是:晶體報告初始化在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 Framework 4
  • 的Visual Studio 2012
  • 水晶報告13.0.2

並且有時會安裝CRRuntime_64bit_13_0_2。

任何人都可以幫助我嗎?

回答

1

一個可能的解決

轉到您的應用程序項目,右鍵單擊,選擇「屬性」

在生成選項卡,找到目標平臺的組合框。它可能會說,「任何CPU」。

將其更改爲x86,並且您的項目將僅編譯爲32位,從而消除此問題。