. Advertisement .
..3..
. Advertisement .
..4..
The error
Retrieving the COM class factory for component with CLSID {46521B1F-0A5B-4871-A4C2-FD5C9276F4C6} failed due to the following error: 80040154.
occurred when I deploy a Windows service using C#.NET( in Windows Server 2008 64 bit version) to generate PDF report. I’ve tried to fix it for some days but have not resolved it yet. Can someone suggest a relevant solution to fix the retrieving the com class factory for component with clsid issue? Much appreciate your support.
The cause: It appears that your service was created to run on “Any CPU,” which is why you are encountering issues on 64-bit systems when using COM components.
Solution: Build the program for
x86
in order to correct the issue. The component can be used by the website because it most likely operates as a 32-bit process. Your service must run as 32-bit if you build your solution forx86
.Similar problem occurred to me.
I needed to use an older 32-bit DLL in a Web Application which was being built on a 64 bit machine. I used the version of regsrv32 to register the 32-bit DLL in the windowssysWOW64 directory.
The calls to the third party DLL were successful in unit tests in Visual Studio, but failed in the Web Application hosted on IIS on the same machine as the 80040154 error.
The issue was resolved by changing the application pool to allow 32-bit applications.