C# – Retrieving the COM class factory for component with CLSID failed due to the following error: 80040154 Class not registered

asp.netc

I have a web application which is used to send email. In this application, I am reading data from an Excel file and send email.
This is working fine in the local system, but not working after uploading on the server.

I have received the following errors

Retrieving the COM class factory for component with CLSID
{00024500-0000-0000-C000-000000000046} failed due to the following
error:

80040154 Class not registered (Exception from HRESULT: 0x80040154
(REGDB_E_CLASSNOTREG)).

How can I fix it?

Best Answer

Solution: to this badimageformatexception is setting the 'Enable32bitApplications' to 'True' in IIS Apppool properties for the right apppool.

Related Topic