[英]IIS and IISExpress with COM libraries
My Web Application working with COM library, I use this code:我的 Web 应用程序与 COM 库一起使用,我使用以下代码:
Type headType = Type.GetTypeFromProgID("Eapi.Head");
dynamic head = null;
head = Activator.CreateInstance(headType);
And I have some problem with understanding working IIS.而且我在理解工作 IIS 时遇到了一些问题。 When I debug my webapp in VisualStudio, running IISExpress and all work.
当我在 VisualStudio 中调试我的 webapp 时,运行 IISExpress 并且一切正常。 But after publication project on IIS, application is not find COM library.
但是在 IIS 上发布项目后,应用程序找不到 COM 库。
HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)
HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)
IIS on same computer as I'm develop project. IIS 在我开发项目的同一台计算机上。
Im registry this dll 2 ways:我注册这个 dll 2 方式:
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>
When it comes to 0x80040154
REGDB_E_CLASSNOTREG
and you are sure you registered COM server, the likely problem is 32/64 bitness mismatch.当涉及
0x80040154
REGDB_E_CLASSNOTREG
并且您确定您已注册 COM 服务器时,可能的问题是 32/64 位不匹配。
Regardless of which regsvr32 you use, it would register in-process COM server with the bitness of the DLL .无论您使用哪个 regsvr32,它都会使用 DLL 的位数注册进程内 COM 服务器。
IIS application pool has its own bitness setting and when the two mismatch your in-process COM server becomes unavailable. IIS 应用程序池有自己的位数设置,当两者不匹配时,您的进程内 COM 服务器将不可用。
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 :典型的解决方案是分别为其他位数和寄存器构建 DLL,或更改 IIS 应用程序池位数以达到匹配, 请参阅此处的说明:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.