cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to cast COM object of type

0 Kudos

My Application (WEBAPI with Crystal Reports in Visual Studio 2019) runs fine in my local machine. However, when i deploy it to the test server. I am getting the below error when i run an API in the test environment. Test server has SAP Crystal Reports Runtime Engine 32 Bit Installed.

Error Details:

Unable to cast COM object of type 'CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass' to interface type 'CrystalDecisions.ReportAppServer.Controllers.ISCRReportSource'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{31E7715A-8AD0-4D1C-958E-C1BE0A6F2D0C}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

System.InvalidCastException: Unable to cast COM object of type 'CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass' to interface type 'CrystalDecisions.ReportAppServer.Controllers.ISCRReportSource'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{31E7715A-8AD0-4D1C-958E-C1BE0A6F2D0C}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

DellSC
Active Contributor
0 Kudos

I changed your tag to "SAP Crystal Reports, version for Visual Studio" because your question is about an application that uses the .NET runtime. The "SAP Crystal Reports" tag is for general questions about report design and the desktop version of SAP Crystal Reports.

-Dell

Accepted Solutions (1)

Accepted Solutions (1)

DellSC
Active Contributor
0 Kudos

When you installed the runtime, were you logged in with Administrator rights? This is a requirement for the runtime to create all of the required registry entries.

Is your application set to explicitly target 32-bit, 64-bit, or Any CPU? NOTE: this is the application itself, not the Windows architecture where it's installed. Since you installed the 32-bit runtime, I'm going to assume that your app is 32-bit. When you registered it in IIS, did you create a 32-bit application pool for it? If not, this is your problem because the application is running in the default application pool, which is 64-bit on a 64-bit server. There are two options for resolving this:

1. Uninstall the 32-bit runtime and install the 64-bit runtime.

2. Create a 32-bit application pool in IIS and set your application to run within that.

-Dell

Answers (0)