简体   繁体   中英

Deploying website using a COM interface to IIS causes class not registered error

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

  1. Ensuring that the dll containing the class IS in fact registered. I made sure that the entry in the registry matched the CLSID that the error stated it failed to load.
  2. Unregistering the dll and re-registering it using regsvr32.exe
  3. Following the advice in this question . The class I'm trying to use is not a service though, so I'm not sure how relevant that question is to my issue.
  4. Following the advice in this question . Again, I'm not sure how relevant that is since that question states that it is an access denied error.
  5. Restarting my machine after unregistering and re-registering the dll
  6. Changing the Platform target of my project from 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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM