locked
Type initializer Error RRS feed

  • Question

  • I experience the following error deploying our application to a server.

    "The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception"

    Development Machine:
    Windows 7 x64
    Visual Studio 2010

    Server (Deployed too):
    Windows Server 2008 x64

    Application:
    Basic winforms application

    Notes:
    Set Target CPU in compile options to x86 in VS
    Installed CR runtime on the server : CRforVS_redist_install_64bit_13_0_1

    References:

    C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet\CrystalDecisions.CrystalReports.Engine.dll
    C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet\CrystalDecisions.ReportSource.dll
    C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet\CrystalDecisions.Shared.dll
    C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet\CrystalDecisions.Windows.Forms.dll

    Any help much appreciated. Thank you.

    Please note:  also posted at http://forums.sdn.sap.com/thread.jspa?messageID=10468378&#10468378


    • Edited by Reafidy Thursday, July 21, 2011 9:19 AM formatting
    Thursday, July 21, 2011 9:18 AM

Answers

  • Hi Don,

    Thanks for your response.

    My apologies with the link, the correct one is http://forums.sdn.sap.com/thread.jspa?threadID=2000486&tstart=0

    It is a windows forms application.  Yes I have searched extensively for info.  Most similar topics seem to suggest that the problem is with the app not being able to find the runtime files.  To install the runtimes and make sure that the target CPU is x86.  I have done that.

    It has been suggested at the SAP site I should have installed the 32 bit runtime because my app is 32 bit.  I installed the 64 bit runtime as the server is 64 bit.  What do you make of that?

    Cheers,
    Reafidy 


    • Proposed as answer by SAPDon Friday, July 22, 2011 2:51 PM
    • Marked as answer by Reafidy Friday, July 22, 2011 11:44 PM
    Thursday, July 21, 2011 9:30 PM

All replies

  • Hello,

    The link to SAP Forums doesn't work. Which forum did you post it in? Should be in here: http://forums.sdn.sap.com/forum.jspa?forumID=313

    Is this a Windows or WEB app?

    Have you search both here and SAP form more info and configuration settings you need to use?

    Don


    Don Williams
    Thursday, July 21, 2011 2:08 PM
  • Hi Don,

    Thanks for your response.

    My apologies with the link, the correct one is http://forums.sdn.sap.com/thread.jspa?threadID=2000486&tstart=0

    It is a windows forms application.  Yes I have searched extensively for info.  Most similar topics seem to suggest that the problem is with the app not being able to find the runtime files.  To install the runtimes and make sure that the target CPU is x86.  I have done that.

    It has been suggested at the SAP site I should have installed the 32 bit runtime because my app is 32 bit.  I installed the 64 bit runtime as the server is 64 bit.  What do you make of that?

    Cheers,
    Reafidy 


    • Proposed as answer by SAPDon Friday, July 22, 2011 2:51 PM
    • Marked as answer by Reafidy Friday, July 22, 2011 11:44 PM
    Thursday, July 21, 2011 9:30 PM
  • Thanks to all those who looked at my question.  The issue was solved by a member at SAP.  

    The issue was that I had incorrectly assumed that the CR 64 bit runtime should be installed as it was a 64 bit server.  Instead I should have installed the runtime to match the application (32bit) regardless of the operating system.

     

    Thursday, July 21, 2011 11:12 PM