由于以下错误,检索 CLSID 为 {00020906-0000-0000-C000-000000000046} 的组件的 COM 类工厂失败:80070005

发布于 2024-09-13 20:31:35 字数 578 浏览 0 评论 0原文

当我的 Web 服务尝试通过 .net webb 服务以编程方式打开 MS Word 文档时,我收到上述错误。 当我通过 Visual Studio 运行 Web 服务时,它工作正常,但是当我在 IIS 7 上部署 Web 服务时,出现错误

检索 COM 类工厂 具有 CLSID 的组件 {00020906-0000-0000-C000-000000000046} 由于以下错误而失败: 80070005

我见过类似的问题,并在 Stackoverflow、MSDN 和其他资源上尝试过他们的解决方案,但没有一个对我有用。大多数问题都是 2008/2007 年的旧问题。

我尝试使用 dcomcnfg 命令更改 DCOM 设置,并且添加了“网络服务”、“网络”用户,还在“Microsoft Word 文档”中添加了我自己的用户 ID组件属性并授予它们完全权限。我还在 web.config 中添加了 impersonate=true 属性。完成这一切之后我也收到错误。有人可以帮我吗?

我正在 MS vista 32 位操作系统上尝试所有这些,Office 版本是 Office 2003。

I am getting the above mentioned error when my web service tries to open MS word document programatically through my .net webb service.
When I run web service through visual studio, it works fine but when I deploy web service on IIS 7, I get the error

Retrieving the COM class factory for
component with CLSID
{00020906-0000-0000-C000-000000000046}
failed due to the following error:
80070005

I have seen similar questions and tried their solutions on Stackoverflow, MSDN and other resources also but none of them worked for me. Most of the questions were old dating back to 2008/ 2007.

I have tried to change DCOM setting using dcomcnfg command and I have added 'Network Service', 'Network' users, also have added my own user id in 'Microsoft Word Document' component properties and given them full permission. I have also added impersonate=true property in web.config. After doing all this also I am getting error. Can anyone please help me out?

I am trying all this on MS vista 32 bit OS and Office version is Office 2003.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怎言笑 2024-09-20 20:31:35

我没有使用 Web 服务,而是使用 Windows 服务,并且当该服务调用尝试创建 Excel 对象的可执行文件时,我生成了相同的错误。我还阅读了许多其他资源,但没有一个对我有用。有几个非常接近,这导致我通过以下方式解决了问题:

  1. 我转到服务器...开始..运行并运行“dcomcnfg”。
  2. 导航至组件服务...计算机...我的电脑...DCOM 配置...Microsoft Excel 应用程序。
  3. 打开属性并选择“身份”选项卡。
  4. 选择“启动用户”(而不是“交互式用户”)单选按钮,然后单击“确定”关闭属性对话框。

错误消失,并且应用程序在服务运行时生成 Excel 文件。

我正在调查是否可以通过其他方式从 Windows 服务中获得此功能,因为我不确定此解决方案是否会产生副作用。如果我发现其他问题,我会进一步更新。

I'm not using a web service, but a windows service and I had the same error generated when the service called an executable that attempted to create an Excel object. I've also read many of the other resources and none of them quite worked for me. Several were very close which led me to solve the issue in the following way:

  1. I went to the server...Start..Run and ran "dcomcnfg".
  2. Navigate to Component Services...Computers...My Computer...DCOM Config...Microsoft Excel Application.
  3. Open properties and select the Identity tab.
  4. Select "The launching user" (instead of "The interactive user") radio button and click OK to close the properties dialog.

The error went away and the app produces the Excel file when the service runs.

I'm investigating if it is possible to get this working from a Windows service some other way because I'm not sure if this solution will have side effects. I will update further if I figure anything else out.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文