检索具有CLSID错误:8000401a的组件的COM类工厂

从上次这么多次我得到以下错误。因为我使用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的访问权限但仍然得到相同的DCOMCNFG但在一段时间它正常工作…所以我认为代码不是问题。 以及how I will find which account is using my current application. (例如网络服务,管理员等)

我找到了解决方案,

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

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

如果我能找到一个更好的解决方案,我的想法是将所有人放在一起

看一下这个

http://docx.codeplex.com/

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