0

My Web Application working with COM library, I use this code:

Type headType = Type.GetTypeFromProgID("Eapi.Head");
dynamic head = null;
head = Activator.CreateInstance(headType);

And I have some problem with understanding working IIS. When I debug my webapp in VisualStudio, running IISExpress and all work. But after publication project on IIS, application is not find COM library.

HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)

IIS on same computer as I'm develop project.

Im registry this dll 2 ways:

C:\WINDOWS\system32>regsvr32.exe c:\EOS\Delo\API\Eapi.dll
C:\WINDOWS\system32>cd ..
C:\Windows>cd SysWOW64
C:\Windows\SysWOW64>regsvr32.exe c:\EOS\Delo\API\Eapi.dll
C:\Windows\SysWOW64>
2
  • 1
    Should be 32/64 bitness problem, registering twice as described does not make sense to me - you will still register one of the bitnesses. You should be able to switch bitness in IIS pool settings (toggle "Enable 32-bit applications" advanced setting).
    – Roman R.
    May 28, 2020 at 10:52
  • @RomanR.Oh my god! Yes! its work. My bad. I solve this problem the third day and have no idea "whats wrong". Thank you so much!
    – GRiN_STONE
    May 28, 2020 at 11:09

1 Answer 1

0

When it comes to 0x80040154 REGDB_E_CLASSNOTREG and you are sure you registered COM server, the likely problem is 32/64 bitness mismatch.

Regardless of which regsvr32 you use, it would register in-process COM server with the bitness of the DLL.

IIS application pool has its own bitness setting and when the two mismatch your in-process COM server becomes unavailable.

Typical solutions are either build DLL for the other bitness and register respectively, or change IIS application pool bitness to reach the matching, see instructions here:

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.