从上次开始,我多次收到以下错误。因为我正在使用 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
任何人都可以建议我任何解决方案。因为我还得到了一些解决方案,要求我使用以下命令更改 Word dll 的访问权限DCOMCNFG
但仍然遇到相同的错误。但有时它可以正常工作......所以我认为代码不是问题。
并且how I will find which account is using my current application.
(例如网络服务、管理员等)
我找到了解决方案,
使用 DCOMCNFG.exe 打开它并转到组件服务 -> 计算机 -> 我的电脑 -> DCOM Config ->
检查 Microsoft Office Word 选项并选择“安全”选项卡。在这里,您将获得“启动和激活权限”选项 -> 选择“自定义”,然后单击“编辑”,然后添加将以完全访问权限运行应用程序的用户。
就这样,这解决了我的问题,希望这会有所帮助。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)