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.
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.