【问题标题】:Retrieving the COM class factory for component with CLSID Error: 8000401a检索具有 CLSID 错误的组件的 COM 类工厂:8000401a
【发布时间】:2012-04-25 18:12:41
【问题描述】:

从上次开始我收到以下错误。因为我使用 Microsoft Word dll 创建进一步附加到邮件的 word 文件。

Server Error in '/' Application.
Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[COMException (0x8000401a): Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a.]
   iPortal.user.sendRAMail.GetData(Object fileName) in XXX:512
   iPortal.user.sendRAMail.btnSend_Click(Object sender, EventArgs e) in XXX:1300
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +107
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3436


Version Information: Microsoft .NET Framework Version:2.0.50727.4216; ASP.NET Version:2.0.50727.4223 

任何人都可以建议我任何解决方案。因为我也有一些解决方案说我使用DCOMCNFG 更改 Word dll 的访问权限,但仍然得到相同的错误。但有时它可以正常工作。 ..所以我认为代码不是问题。 还有how I will find which account is using my current application.(例如网络服务、管理员等)

【问题讨论】:

  • 0x8000401a = CO_E_RUNAS_LOGON_FAILURE,虽然听起来你可能已经知道了?安全事件日志中有什么明显的东西吗?
  • 嗨@Rup 感谢您的回复,我检查了安全日志,但没有提到错误。但应用程序日志有相同的警告。显示Retrieving the COM class factory for component with CLSID 错误

标签: c# asp.net com asp.net-2.0


【解决方案1】:

我找到了解决办法,

使用 DCOMCNFG.exe 打开它并转到组件服务->计算机->我的电脑->DCOM 配置-> 检查 Microsoft Office Word 选项并选择选项卡安全性。在这里您将获得启动和激活权限选项-> 选择自定义并单击编辑并添加将以完全访问权限运行您的应用程序的用户。

就是这样,这解决了我的问题,这将有所帮助。

【讨论】:

  • 谢谢,为我工作。对于使用 OpenOffice 的用户,请检查 DCOM Config 下的 OpenOffice 选项。
【解决方案2】:

如果我能找到更好的解决方案,我的想法是一起摆脱 Com ,我会使用它

看看这个

http://docx.codeplex.com/

【讨论】:

  • 我一般不同意这种观点,但在 ASP.NET 内部,您绝对应该避免自动化 Word,是的。
【解决方案3】:

我在服务器上做的一件事是在机器上打开 Microsoft Word,这似乎导致错误消失。

【讨论】:

    【解决方案4】:

    您可以创建另一个用户,然后使用该用户登录并创建远程到 121.0.0.1 和主用户(环回 rpc !!!)然后从新用户断开连接,您将拥有交互式用户

    【讨论】:

      猜你喜欢
      • 2011-05-14
      • 2012-02-17
      • 2023-04-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多