简体   繁体   English

IIS 和 IISExpress 与 COM 库

[英]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.

相关问题 Xaml IIS 中的渲染不起作用(但在 IISExpress 中) - Xaml Rendering in IIS not working (but in IISExpress) Blazor Webassembly EditForm 在 IISExpress 上工作,但在 IIS 上有问题 - Blazor Webassembly EditForm works on IISExpress but has Problem on IIS Blazor 应用程序不在 IIS 上维护其状态,但在 IISExpress 上运行良好 - Blazor app not maintainintg its state on IIS, but works fine on IISExpress 无法将 IIS 托管应用程序写入 Ubuntu 中的共享文件夹,但 IISExpress 没有问题 - Unable to write IIS hosted application to a shared folder in Ubuntu but no problem with IISExpress 在IIS 7中使用COM对象 - Use of COM object in IIS 7 将站点上载到IIS,找不到控制器资源(错误500)。 使用iisexpress在本地工作 - Uploaded site to IIS, cannot find controller resource (error 500). Works locally using iisexpress HTTP错误403.14 - 在IIS8服务器上禁止。 但是,在本地VS2013上工作(IISExpress) - HTTP Error 403.14 - Forbidden on IIS8 Server. However, Working on local VS2013(IISExpress) 如何使用SQLSERVERSMO的COM库? - How to consume com libraries for SQLSERVERSMO? 应用程序与IIS上的COM托管一起使用 - Application working with COM hosting on IIS .NET 框架 API Swashbuckle (Swagger) 在开发中显示 iisexpress 上的所有参数,但在产品上显示 IIS Server 2019 未显示所有参数 - .NET Framework API Swashbuckle (Swagger) shows all params on iisexpress in dev but on prod IIS Server 2019 not showing all params
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM