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

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

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

关于c# - 检索具有 CLSID 错误 : 8000401a 的组件的 COM 类工厂,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10139834/

相关文章:

c# - MS UnitTestFramework 检索和记录异常 c#

c# - MVC C# 重定向到另一个 Controller

c# - 缓慢的 WPF 4 数据网格刷新

c# - Linq2Sql : Manage DataContext

c++ - 什么是 com 对象,我该如何使用它?

c# - .NET 中的 CoCreateInstance 完全匹配?

c++ - 在 idl 中使用 importlib 时,自动生成的 .tlh 中的编译器错误 C3646 'unknown override specifier'

c# 将小数转换为逗号分隔的字符串

asp.net - Blogger API v3.0 - 与用户合作 (OAuth 2.0)

c# - 中等信任下的 ODP.net 访问违规