I have an ASP.NET site that needs to use a COM interface that we developed. When I test the website within the visual studio environment, it works fine. However, when I go to deploy the site to IIS, I receive an error stating
Retrieving the COM class factory for component with CLSID {0716BE95-6372-46B2-B42D-9FC0ED5E0FE3} failed due to the following error: 80040154 Class not registered
I've tried a few things
Any CPU
to x86
as suggested in this answer. This causes another problem. Could not load file or assembly 'TestWebSimpleMath' or one of its dependencies. An attempt was made to load a program with an incorrect format.
which I think is a step backwards.I'm running Windows 7 Ultimate edition 64 bit.
Any help would be great. I've been trying to get this working for nearly 9 hours with no luck.
Class not registered error in Windows is an error that usually occurs when trying to open an app or program in Windows. The error occurs mainly due to unregistered DLL files within the app or program. Sometimes, the file may become unregistered for certain reasons. It may appear in Windows 10, 8, and 7.
Reason:
Your service was built against 'Any CPU' causing you errors on 64bit where you are using COM components. You need to build it for 'x86'.
Solution:
In Visual Studio, right click on the PROJECT then select PROPERTIES. Click the BUILD tab then under PLATFORM TARGET change Any CPU to X86.
Possible duplicate of this question.
Update:Enable 32 bit application
Go to IIS -> Application Pool -> Advance Settings -> Enable 32-bit Applications
check this related question
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With