开发者

COM dll error when tried from IIS

I have an ASP.NET 3.5 application where I am using an ActiveX control. When I try to run the website from Visual Studio 开发者_开发知识库2008 using built-in web server it is working like a charm.

When I publish the same code to IIS I get the following error:

Retrieving the COM class factory for component with CLSID {ADAACEC8-D9F2-4E05-A5F3-D29E5C9C82F9} failed due to the following error: 80040154. 

How can I fix this issue??


The HRESULT in the error message (80040154) usually means 'Class not Registered'.

Try re-registering the component:

regsvr32.exe MyActiveX.dll /u
regsvr32.exe MyActiveX.dll


could be a number of reasons. http://support.microsoft.com/kb/257757 listed some of them. In addition to the problems mentioned in the article, there could be some DLL loading issue, such as the COM DLL may not support the CPU architecture of the application pool, or one of its dependencies can not be found or can not be accessed.


Just a guess. You can add to you web.config file

<identity impersonate="true" userName="Domain\MyUsername" password="MyPassword"/>

Once i had a similar problem and this solved it.


To build on what Kev and Sheng Jiang 蒋晟 have said, it sounds like the COM component isn't registered properly or is having a bitness issue.

Is the activex DLL written in C++/compiled specifically for 32 or 64 bit/ or use DLLs that are specifically 32 or 64 bit?

  • If so you might need to configure IIS so that it runs the asp.net worker processes as 32 or 64 bit as necessary. Check out Running 32-bit Applications on 64-bit Windows

If the ActiveX dll can run in either an x86 or x64 process, then it might not be registered correctly.

  • If IIS is running as a x64 process register the COM component with C:\Windows\system32\regsvr32.exe.
  • If IIS is running the component in x86/32bit worker processes try registering it with C:\Windows\syswow64\regsvr32.exe
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜