我在 IIS 7(Win 2008 64 位)下创建远程 DCOM 对象时遇到问题。在服务器端有 WCF 服务,它使用旧的 DCOM 组件作为数据源。在 Web 开发服务器和测试中一切正常,但在 IIS 7 下创建远程对象失败,并出现“ System.UnauthorizedAccessException : Retrieving the COM class factory for remote component with CLSID {DAF3140A-C132-11D2-85FB-004033D061E9} from machine IP由于以下错误而失败:80070005 IP”。
我知道有很多关于 80070005 错误的文章,但我已经尝试了一切 - 没有成功。
下面是如何创建 DCOM 对象的代码片段:
Type objBlType = Type.GetTypeFromProgID("NetCatService.CatalogServer.1", netCatServerAddress, true);
instance = Activator.CreateInstance(objBlType);
我已经使用 DCOM Config 授予“每个人”对我的 DCOM 对象的访问权限,我尝试将 IIS 应用程序池配置为使用网络服务帐户,并且还授予“网络服务”对 DCOM 的访问权限 - 没有运气。我使用Procmon工具来找出使用的其他资源,但没有什么有趣的。
我在 web.config 文件中添加了以下几行,但也没有成功
<system.web>
<trust level="Full" />
<identity impersonate="true" password="pass" userName="userName" />
</system.web>
你能帮我解决这个问题吗?有任何想法吗?
谢谢