IIS REST 应用程序访问拒绝 COM+ 通信

IIS rest application access denied for COM+ communication

我在 C# 中为 IIS 创建了一个 REST 应用程序,它使用一个应用程序作为参考 (COM+)。此应用程序 运行ning 具有管理员权限(运行 作为管理员),我的 REST 应用程序 运行ning 在 IIS 上。

如果我尝试使用 REST 应用程序,我总是收到一条错误消息:

ERRORRetrieving the COM class factory for component with CLSID {50F8C6E6-ED30-11D4-8D25-00010211E6C5} failed due to the following error: 80070005 Access is denied. (0x80070005 (E_ACCESSDENIED)).

如果我更改具有 Administrators 组成员身份的本地用户的应用程序池身份,则会收到此消息:

ERRORUnable to cast COM object of type 'MyService.ExampleClass' to interface type 'MyService.ICoAppTransport'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{50F8C6E4-ED30-11D4-8D25-00010211E6C5}' failed due to the following error: The object invoked has disconnected from its clients. (0x80010108 (RPC_E_DISCONNECTED)).

我在这里检查了很多 post 但我找不到解决方案。有人可以帮忙吗?

尝试使用“regsvr32”重新注册 DLL 文件以注册它支持的 COM 类,或者您的 EXE 的“位”(32/64 位)。

将应用程序池启用 32 位设置为“True”

将应用程序池标识设置为“本地系统”或具有足够访问权限的自定义用户。

转到组件服务 » 计算机 » 我的电脑 » DCOM 配置 » 检查您正在使用的组件选项和 select 选项卡安全。在这里,您将获得启动和激活权限的选项 » select 自定义并单击编辑,然后添加 IIS_IUSRS、IUSR、具有完全访问权限的网络服务。