C# 检索CLSID错误为8000401a的组件的COM类工厂

C# 检索CLSID错误为8000401a的组件的COM类工厂,c#,asp.net,com,asp.net-2.0,C#,Asp.net,Com,Asp.net 2.0,从上一次这么多次我得到以下错误。因为我正在使用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

从上一次这么多次我得到以下错误。因为我正在使用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
更改单词DLL的访问权限,但仍然会出现相同的错误。但有时它工作正常…所以我认为代码不是问题。
还有
我将如何找到哪个帐户正在使用我当前的应用程序。
(例如网络服务、管理员等)

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

看看这个

我找到了解决办法

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


仅此而已,这就解决了我的问题。这将有所帮助。

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

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

0x8000401a=CO_E_RUNAS_LOGON_失败,尽管听起来您可能已经知道了这一点?在安全事件日志中有什么明显的东西吗?Hi@Rup感谢您的回复,我检查了安全日志,但没有提到任何错误。但是应用程序日志有相同的警告。显示了
检索组件的COM类工厂(带有CLSID)
错误我不同意这种看法,但从ASP.NET内部来看,你应该绝对避免自动执行Word,是的。谢谢,为我工作。对于使用OpenOffice的用户,请检查DCOM配置下的OpenOffice选项。