locked
CR for VS2010 - Error: TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. RRS feed

  • Question

  • User1444658467 posted

    Hi all. I'm new in the forums and I would like to ask you for help about a problem I'm having with Crystal Reports for a week.

    I'm using Crystal Reports for VS2010 in a 64 bits machine. Reports work ok. When uploading the ASP.NET Project to a shared server (64 bits as well), it fails:

    Retrieving the COM class factory for component with CLSID {4DB2E2BB-78E6-4AEA-BEFB-FDAAB610FD1B} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {4DB2E2BB-78E6-4AEA-BEFB-FDAAB610FD1B} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)). 

    ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user. 

    To grant ASP.NET access to a file, right-click the file in File Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

    Source Error: 

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace: 

    [UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {4DB2E2BB-78E6-4AEA-BEFB-FDAAB610FD1B} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).]
       CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor() +298
    
    [TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception.]
       CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor() +38
       Informe.InformeFacturaProforma() +124
       Informe.Page_Load(Object sender, EventArgs e) +69
       System.Web.UI.Control.OnLoad(EventArgs e) +92
       System.Web.UI.Control.LoadRecursive() +54
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772

    The technical support of the hosting say me that several projects using CR are hosted in the same server as mine. 

    Anyone could give me a clue?

    Thanks in advance.

    Sunday, March 3, 2013 1:05 PM

Answers

  • User1444658467 posted

    Reports works now in server correctly.

    It was a issue regarding the applicattion pool that needed to be adjusted. It was done by the server admin so I don't know what they adjusted exactly.

    Thanks

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 4, 2013 7:20 AM

All replies

  • User281315223 posted

    Just a shot in the dark, but have you taken a look at this discussion on Stack Overflow?

    Sunday, March 3, 2013 6:23 PM
  • User1444658467 posted

    Hi Rion and first of all thank you for your quick response. As my web site is hosted in a shared server, the majority of the possible solutions are not easy to do for me. 

    The most weird thing is that the same server is already hosting several projects using CR...

    May it be a assemblies version issue? They installed in my server a folder called "crystalreportviewers13", and my assemblies registered in my web.config are:

    <add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
    <add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
    <add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
    <add assembly="CrystalDecisions.ReportAppServer.Controllers, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
    <add assembly="CrystalDecisions.ReportAppServer.DataDefModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
    <add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
    <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />

    So I guess the version is not the problem....

    Sunday, March 3, 2013 8:39 PM
  • User1444658467 posted

    Reports works now in server correctly.

    It was a issue regarding the applicattion pool that needed to be adjusted. It was done by the server admin so I don't know what they adjusted exactly.

    Thanks

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 4, 2013 7:20 AM